You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2007/11/04 23:26:21 UTC

svn commit: r591857 - /maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt

Author: dennisl
Date: Sun Nov  4 14:26:20 2007
New Revision: 591857

URL: http://svn.apache.org/viewvc?rev=591857&view=rev
Log:
o Add instructions on how to install the sources jar along with the artifact.

Modified:
    maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt

Modified: maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt?rev=591857&r1=591856&r2=591857&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt Sun Nov  4 14:26:20 2007
@@ -20,4 +20,73 @@
 mvn source:test-jar
 +-----+
 
+*Installing the sources along with your artifact
 
+  There are two ways to do this. You can either bind this plugin to a phase or
+  you can add it to a profile.
+
+**Installing the sources using a phase binding
+
+  Here is how you would configure the plugin in your <<<pom.xml>>> to run
+  automatically during the <verify> phase:
+
++-----+
+<project>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  ...
+</project>
++-----+
+
+  We are using the <verify> phase here because it is the phase that comes
+  before the <install> phase, thus making sure that the sources jar has been
+  created <<before>> the install takes place.
+
+**Installing the sources using a profile
+
+  If you want to install a jar of your sources along with your artifact during
+  the release process, you can add this to your <<<pom.xml>>> file:
+
++-----+
+<project>
+  ...
+  <profiles>
+    <profile>
+      <id>release</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-source-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-sources</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  ...
+</project>
++-----+