把maven打包生成的jar,和依赖的lib下的jar按结构复制到libs下,maven中添加以下插件即可
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-lib-src-webapps</id>
<phase>package</phase>
<configuration>
<tasks>
<!--把target下生成的jar和lib文件夹下的文件copy到libs下-->
<copy todir="libs">
<fileset dir="target">
<include name="*.jar" />
</fileset>
</copy>
<copy todir="libs/lib">
<fileset dir="lib">
<include name="*" />
</fileset>
</copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>