maven2 打包问题 请问我用 mvn package 命令打包工程为一个jar文件时怎么把需要用到的本地库里的jar文件都打包进去 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是在pom.xml中定义的那些jar文件 jar不会复制依赖的。你用mvn dependency:copy-dependencies好了。 设置好package的类型后mvn package应该就会把需要的jar打进去吧 <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-5</version> <executions> <execution> <id>create-executable-jar</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>foo.bar.App</mainClass> </manifest> </archive> </configuration> </plugin>然后 maven assembly:assembly就行。 JAVA 爬虫翻页问题(十万火急) 有空的进来帮我看看这个小问题 filter出错,导致页面显示为空 Hibernate映射问题 tomcat为什么不能运行jsp,达人急入! JAVA开发 SNMP协议的问题 iReprot中要用表格的形式显示出来那些像excel中的线应该怎么运用的,怎么来实现的 java 到底能做什么!!! 谁有 Struts & BC4J 的资料啊 分数大大的有啊 2 如何用Tomcat架设服务器? struts2与hibernate和拦截器 急需解答 谢谢 请各位前辈帮忙找错
mvn package应该就会把需要的jar打进去吧
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<executions>
<execution>
<id>create-executable-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>foo.bar.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>然后 maven assembly:assembly就行。