This plugin simply wraps an invocation of the Maven Assembly Plugin's built-in project assembly, which creates archives containing a buildable project directory. It is basically an archive of your project's root directory without including any of the files created when the build runs.
This plugin was created to make the creation of project-sources archives as simple as declaring a plugin execution with a single goal and no configuration whatsoever. One handy side effect is that it also allows tools to inject project-sources creation into project POMs without affecting pre-existing assembly plugin executions.
As of the 1.0 release, this plugin includes a META-INF/m2e/lifecycle-mapping-metadata.xml file that tells m2eclipse to ignore it when Eclipse rebuilds your project.
It's a pretty simple configuration:
<plugin>
<groupId>org.jboss.pnc</groupId>
<artifactId>project-sources-maven-plugin</artifactId>
<version>${projectSrcVersion}</version>
<executions>
<execution>
<id>project-sources</id>
<goals>
<goal>archive</goal>
</goals>
</execution>
</executions>
</plugin>
If you find that you need to disable this plugin for a specific build, you can use the -Dproject.src.skip=true command-line option.
To create source archive with root folder myFolderName
<plugin>
<groupId>org.jboss.pnc</groupId>
<artifactId>project-sources-maven-plugin</artifactId>
<version>${projectSrcVersion}</version>
<executions>
<execution>
<id>project-sources</id>
<goals>
<goal>archive</goal>
</goals>
</execution>
</executions>
<configuration>
<assemblyRootFolder>myFolderName</assemblyRootFolder>
</configuration>
</plugin>
By default source archive format is "tar.gz". Use "formats" configuration option to specify different or additional formats (see https://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#formats ) Formats are comma separated.
Eg. to generate tar.gz and zip format
<plugin>
<groupId>org.jboss.pnc</groupId>
<artifactId>project-sources-maven-plugin</artifactId>
<version>${projectSrcVersion}</version>
<executions>
<execution>
<id>project-sources</id>
<goals>
<goal>archive</goal>
</goals>
</execution>
</executions>
<configuration>
<formats>tar.gz, zip</formats>
</configuration>
</plugin>
