Automatically build source archive in package phase.

This commit is contained in:
Michael Jumper
2013-07-13 19:14:38 -07:00
parent 88d4a5004b
commit e2a0bdf53b
3 changed files with 58 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
*~ *~
target/

33
pom.xml
View File

@@ -29,4 +29,37 @@
</modules> </modules>
<build>
<plugins>
<!-- Assembly plugin - for easy distribution -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<!-- Build project archive -->
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>project-assembly.xml</descriptor>
</descriptors>
</configuration>
<!-- Bind archive build to package phase -->
<executions>
<execution>
<id>make-source-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>

24
project-assembly.xml Normal file
View File

@@ -0,0 +1,24 @@
<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>project</id>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<exclude>**/*.log</exclude>
<exclude>**/${project.build.directory}/**</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>