Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Maven Source Plug-in

This plug-in builds an archive of the source code. It is based on the maven.compile.src.set property so every directory specified in this property is used to generate the source archive.

The generated source archive will be deployed at ${groupId}/java-sources/${artifactId}-{version}-sources.jar.

For more information on the functionality provided by this plugin, please see the Goals document.

For more information on how to customise the functionality provided by this plugin, please see the properties document.

Downloading a source archive

Similarly to the plugin plugin, the source plugin is able to download a source archive from the configured repository(ies). The following parameters might be set at runtime:

  • groupId: the groupId of the source archive to download
  • artifactId: the artifactId of the source archive to download
  • version: the version of the source archive to download
  • ignoreErrors (optional - default to false): specificy if the build should fail if the source archive is not found
  • backwardCompatible (optional - default to false): specificy if the old source archive location should be checked as well

Example:

          maven source:download
                  -DartifactId=someArtifact
                  -DgroupId=theGroup
                  -Dversion=1.0.0-SNAPSHOT
                  -DbackwardCompatible=true