java - Include dependencies using maven-jar-plugin - Stack Overflow

I've 3 projects business, tools & utils. Tools depends external projects like commons-cli and

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745566248a4633409.html

相关推荐

  • java - Include dependencies using maven-jar-plugin - Stack Overflow

    I've 3 projects business, tools & utils. Tools depends external projects like commons-cli and

    23小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信