标签:hit 技术交流 app copy family pac hive arch classpath
maven-jar-plugin 插件的maven依赖为:
<dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.6</version> </dependency>
一: 打包可运行的jar
配置为:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.6</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> <mainClass>com.lala.shop.App</mainClass> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory> ${project.build.directory}/lib </outputDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build>
二: 打包部分package
比方说。我仅仅想打包com.lala.api*以下的类打包。则配置例如以下
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.6</version> <configuration> <includes> <include>**/api/*</include> </includes> </configuration> </plugin> </plugins> </build>
maven技术交流 扣扣群 379165311,群里面会不定期分享一些maven文章和教程,欢迎大家增加
标签:hit 技术交流 app copy family pac hive arch classpath
原文地址:http://www.cnblogs.com/llguanli/p/6877810.html