maven的打包插件

来源:互联网 发布:搞笑文案知乎 编辑:程序博客网 时间:2024/05/16 05:36

maven自带的打包插件&assembly&shade&sprintboot的打包插件

直接上pom的配置吧:

<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.3.6.RELEASE</version></parent><properties><!-- Spring默认使用jdk1.6,如果你想使用jdk1.8,你需要在pom.xml的属性里面添加java.version --><java.version>1.8</java.version><start-class>com.htsc.warcraft.gateway.Start</start-class><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><vertx.version>3.2.1</vertx.version></properties>

<plugins><!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> --><!-- assembly插件打fat jar,以-with-dependences结尾 --><!-- <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>com.htsc.warcraft.discoveryService.DiscoveryService</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> --><!-- shade插件打fat jar,以fat结尾 --><!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Main-Class>${main.class}</Main-Class> </manifestEntries> </transformer> </transformers> <artifactSet> </artifactSet> <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar </outputFile> </configuration> </execution> </executions> </plugin> --><!-- spring boot 插件打fat jar,该插件配置好了一个shade插件 --><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins>


0 0
原创粉丝点击