maven除了可以打出war包 jar包, 还可以指定目录结构打出tar包
pom.xml 中 packaging 指定为pom, 由maven-assembly-plugin来控制
pom.xml 中 packaging 指定为pom, 由maven-assembly-plugin来控制
<project 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/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hpsc-pagespeed</artifactId>
<groupId>com.hp.hpsc.pagespeed</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>hpsc-pagespeed-config</artifactId>
<packaging>pom</packaging>
<name>HPSC PageSpeed Configuration</name>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptor>src/main/assembly/package.xml</descriptor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>package</id>
<formats>
<format>tar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>/</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
<lineEnding>unix</lineEnding>
<includes>
<include>**/*.conf</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>/</outputDirectory>
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
<excludes>
<exclude>**/*.conf</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>