tar.gz
assembly/sendper5minutes.xml
<packaging>jar</packaging>
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd"> <formats> <format>tar.gz</format> </formats> <dependencySets> <dependencySet> <useProjectArtifact>true</useProjectArtifact> <outputDirectory>lib</outputDirectory> </dependencySet> </dependencySets> <fileSets> <fileSet> <directory>lib</directory> <outputDirectory>lib</outputDirectory> <includes> </includes> </fileSet> <fileSet> <directory>src/main/resources</directory> <outputDirectory>conf</outputDirectory> <includes> <include>applicationContext.xml</include> <include>elasticsearch.properties</include> <include>hbase-site.xml</include> <include>jdbc.properties</include> <include>log4j.xml</include> <include>rabbit-producer-context.xml</include> <include>rabbitmq.properties</include> <include>service.properties</include> </includes> </fileSet> <fileSet> <directory>sh</directory> <outputDirectory>sh</outputDirectory> <includes> <include>senddwrper5minutes.sh</include> </includes> <lineEnding>unix</lineEnding> <fileMode>0744</fileMode> <directoryMode>0644</directoryMode> </fileSet> </fileSets> </assembly>
assembly/war.xml
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd"> <id>assembly</id> <formats> <format>war</format> <format>dir</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <outputDirectory>WEB-INF/lib</outputDirectory> <useProjectArtifact>false</useProjectArtifact> </dependencySet> </dependencySets> <fileSets> <fileSet> <directory>${project.build.outputDirectory}</directory> <outputDirectory>WEB-INF/classes</outputDirectory> </fileSet> <fileSet> <directory>src/main/assembly/bin</directory> <outputDirectory>WEB-INF/classes/lib</outputDirectory> <fileMode>0755</fileMode> </fileSet> <fileSet> <directory>${project.basedir}/src/main/webapp</directory> <outputDirectory>/</outputDirectory> </fileSet> </fileSets> </assembly>
pom
<packaging>war</packaging>
<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-2</version> <executions> <execution> <id>make-tar.gz</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <skipAssembly>false</skipAssembly> <appendAssemblyId>false</appendAssemblyId> <finalName>${project.artifactId}_senddwrper5minutes</finalName> <descriptors> <descriptorRef>assembly/sendper5minutes.xml</descriptorRef> </descriptors> </configuration> </execution> <execution> <id>make-war</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <skipAssembly>false</skipAssembly> <appendAssemblyId>false</appendAssemblyId> <finalName>${project.artifactId}_maven_assembly_plugin</finalName> <descriptors> <descriptorRef>assembly/war.xml</descriptorRef> </descriptors> </configuration> </execution> </executions> </plugin>
以上 包含 assembly 打war 包
第二种 war
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <packagingExcludes> WEB-INF/lib/servlet-api*.jar,WEB-INF/lib/jsp-api-*.jar,WEB-INF/lib/jsp-2.1-*.jar,WEB-INF/lib/*-7.0.54.jar,WEB-INF/lib/*-5.5.23.jar </packagingExcludes> <webResources> <resource> <directory>sql</directory> <includes> <include>self_helper/*.sql</include> </includes> </resource> </webResources> </configuration> <executions> <execution> <id>my-war</id> <phase>war</phase> <goals> <goal>war</goal> </goals> </execution> </executions> </plugin>
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!