码迷,mamicode.com
首页 > 编程语言 > 详细

maven依赖包打到jar包里

时间:2017-05-17 19:15:30      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:single   文件   sem   tor   logs   make   ons   execution   bsp   

 

最近写一个客户端sdk,需要把依赖的jar包都打到生成的jar包里

pom文件添加

<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass></mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

 

target目录会生成-with-dependencies.jar结尾的文件,该jar包就包含了所有依赖的jar包,可以单独运行了。

 

maven依赖包打到jar包里

标签:single   文件   sem   tor   logs   make   ons   execution   bsp   

原文地址:http://www.cnblogs.com/devilfeng/p/6868898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!