Created
November 12, 2014 09:28
-
-
Save EdwardsBean/c4a30e582c2cf4b99049 to your computer and use it in GitHub Desktop.
maven工程打包成tar.gz,并生成conf,bin,lib目录
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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>package</id> | |
<formats> | |
<format>tar.gz</format> | |
</formats> | |
<includeBaseDirectory>true</includeBaseDirectory> | |
<fileSets> | |
<fileSet> | |
<directory>target/bin</directory> | |
<outputDirectory>/bin</outputDirectory> | |
</fileSet> | |
<fileSet> | |
<directory>target/conf</directory> | |
<outputDirectory>/conf</outputDirectory> | |
</fileSet> | |
<fileSet> | |
<directory>target/lib</directory> | |
<outputDirectory>/lib</outputDirectory> | |
</fileSet> | |
<fileSet> | |
<directory>target</directory> | |
<includes> | |
<include>*-core.jar</include> | |
</includes> | |
<outputDirectory>/lib</outputDirectory> | |
</fileSet> | |
</fileSets> | |
</assembly> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<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> | |
<groupId>com.baidu</groupId> | |
<artifactId>grab</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<repositories> | |
<repository> | |
<id>baidu</id> | |
<url>http://maven.scm.baidu.com:8081/nexus/content/groups/public/</url> | |
</repository> | |
<repository> | |
<id>company</id> | |
<url>http://192.168.253.149:8081/nexus/content/groups/public/</url> | |
</repository> | |
<build> | |
<resources> | |
<resource> | |
<directory>src/main/resources</directory> | |
<excludes> | |
<exclude>*.*</exclude> | |
</excludes> | |
</resource> | |
</resources> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>package-jar</id> | |
<phase>package</phase> | |
<goals> | |
<goal>jar</goal> | |
</goals> | |
<configuration> | |
<classifier>core</classifier> | |
<excludes> | |
<exclude>*.properties</exclude> | |
<exclude>*.xml</exclude> | |
<exclude>*.sh</exclude> | |
<exclude>*.conf</exclude> | |
</excludes> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-dependency-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>copy-dependencies</id> | |
<phase>package</phase> | |
<goals> | |
<goal>copy-dependencies</goal> | |
</goals> | |
<configuration> | |
<outputDirectory>${project.build.directory}/lib</outputDirectory> | |
<overWriteReleases>false</overWriteReleases> | |
<overWriteSnapshots>false</overWriteSnapshots> | |
<overWriteIfNewer>true</overWriteIfNewer> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-resources-plugin</artifactId> | |
<version>2.4</version> | |
<executions> | |
<execution> | |
<id>copy-config</id> | |
<phase>package</phase> | |
<goals> | |
<goal>copy-resources</goal> | |
</goals> | |
<configuration> | |
<encoding>UTF-8</encoding> | |
<outputDirectory>${project.build.directory}/conf</outputDirectory> | |
<resources> | |
<resource> | |
<directory>src/main/resources/</directory> | |
<includes> | |
<include>*.xml</include> | |
<include>*.properties</include> | |
<include>*.conf</include> | |
</includes> | |
<filtering>true</filtering> | |
</resource> | |
</resources> | |
</configuration> | |
</execution> | |
<execution> | |
<id>copy-shell</id> | |
<phase>package</phase> | |
<goals> | |
<goal>copy-resources</goal> | |
</goals> | |
<configuration> | |
<encoding>UTF-8</encoding> | |
<outputDirectory>${project.build.directory}/bin</outputDirectory> | |
<resources> | |
<resource> | |
<directory>src/main/resources/</directory> | |
<includes> | |
<include>*.sh</include> | |
</includes> | |
<filtering>true</filtering> | |
</resource> | |
</resources> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<configuration> | |
<finalName>grab</finalName> | |
<appendAssemblyId>false</appendAssemblyId> | |
<descriptors> | |
<descriptor>package.xml</descriptor> | |
</descriptors> | |
</configuration> | |
<executions> | |
<execution> | |
<id>make-assembly</id> | |
<phase>package</phase> | |
<goals> | |
<goal>single</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment