Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Maven Source Plugin

This page provides a space for users to contribute examples, errata, tips and other useful information about the Maven Source Plugin. Everybody is invited to share his/her thoughts about the plugin to help the community to improve it.

Note: Please do not use this page to report bugs or feature requests. Instead, please fill in an issue in the issue tracking system listed in the official plugin documentation.

Thanks!

– The Maven Team

Examples

Manual deploy of source code

Code Block
xml
xml
<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.0.4</version>
        <configuration>
           <!-- your example configuration here -->
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Automatic deploy of source code

With the following configuration sources will be created in target folder with mvn install and deployed to local repo with mvn deploy. It is probably not possible to link this to the deploy phase.

Code Block
xml
xml
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-source-plugin</artifactId>
  <configuration>
    <attach>true</attach>
  </configuration>
  <executions>
    <execution>
      <phase>install</phase>
      <goals>
        <goal>jar</goal>
        <goal>test-jar</goal>
      </goals>
    </execution>
  </executions>
</plugin>

FAQ

How do I ...?

You need to ...