admin管理员组文章数量:1024615
I've 3 projects business
, tools
& utils
. Tools depends external projects like commons-cli
and internal business
& utils
.
I'm using following build configuration.
<plugins>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>my.mainClass</mainClass>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
<excludes>
<exclude>log4j.xml</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
My project builds with following strucure.
tools.jar
lib/
business.jar
utils.jar
common-cli.jar
Is there a way to merge tools.jar, business.jar and utils.jar (to tools-with-dep.jar as those are my internal projects) and have following structure.
tools-with-dep.jar
lib/
commons-cli.jar
I've 3 projects business
, tools
& utils
. Tools depends external projects like commons-cli
and internal business
& utils
.
I'm using following build configuration.
<plugins>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>my.mainClass</mainClass>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
<excludes>
<exclude>log4j.xml</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib/
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
My project builds with following strucure.
tools.jar
lib/
business.jar
utils.jar
common-cli.jar
Is there a way to merge tools.jar, business.jar and utils.jar (to tools-with-dep.jar as those are my internal projects) and have following structure.
tools-with-dep.jar
lib/
commons-cli.jar
本文标签: javaInclude dependencies using mavenjarpluginStack Overflow
版权声明:本文标题:java - Include dependencies using maven-jar-plugin - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745566247a2156464.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论