You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by oc...@apache.org on 2006/05/29 05:25:42 UTC

svn commit: r410016 - in /maven/plugins/trunk/maven-source-plugin/src: main/java/org/apache/maven/plugin/source/ site/ site/apt/

Author: oching
Date: Sun May 28 20:25:42 2006
New Revision: 410016

URL: http://svn.apache.org/viewvc?rev=410016&view=rev
Log:
PR:MSOURCES-5

Added javadocs to the plugin classes. Created intro and configuration docs to the plugin.

Added:
    maven/plugins/trunk/maven-source-plugin/src/site/
    maven/plugins/trunk/maven-source-plugin/src/site/apt/
    maven/plugins/trunk/maven-source-plugin/src/site/apt/configuration.apt
    maven/plugins/trunk/maven-source-plugin/src/site/apt/introduction.apt
    maven/plugins/trunk/maven-source-plugin/src/site/site.xml
Modified:
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractJarSourceMojo.java
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarDefaultSourceMojo.java
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarTestSourceMojo.java
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceBundler.java

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractJarSourceMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractJarSourceMojo.java?rev=410016&r1=410015&r2=410016&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractJarSourceMojo.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractJarSourceMojo.java Sun May 28 20:25:42 2006
@@ -53,6 +53,8 @@
     private MavenProject executedProject;
 
     /**
+     * Specifies whether or not to attach the artifact to the project
+     *
      * @parameter expression="${attach}" default-value="true"
      */
     private boolean attach = true;
@@ -63,12 +65,18 @@
     private MavenProjectHelper projectHelper;
 
     /**
+     * The directory where the generated archive file will be put
+     *
      * @parameter expression="${project.build.directory}"
      * @required
      */
     protected File outputDirectory;
 
     /**
+     * The filename to be used for the generated archive file.
+     * For the source:jar goal, "-sources" is appended to this filename.
+     * For the source:test-jar goal, "-test-sources" is appended.
+     *
      * @parameter expression="${project.build.finalName}"
      * @required
      */

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarDefaultSourceMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarDefaultSourceMojo.java?rev=410016&r1=410015&r2=410016&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarDefaultSourceMojo.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarDefaultSourceMojo.java Sun May 28 20:25:42 2006
@@ -35,6 +35,9 @@
 public class JarDefaultSourceMojo
     extends AbstractJarSourceMojo
 {
+    /**
+     * @see org.apache.maven.plugin.AbstractMojo#execute()
+     */
     public void execute()
         throws MojoExecutionException
     {

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarTestSourceMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarTestSourceMojo.java?rev=410016&r1=410015&r2=410016&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarTestSourceMojo.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/JarTestSourceMojo.java Sun May 28 20:25:42 2006
@@ -33,6 +33,9 @@
 public class JarTestSourceMojo
     extends AbstractJarSourceMojo
 {
+    /**
+     * @see org.apache.maven.plugin.AbstractMojo#execute()
+     */
     public void execute()
         throws MojoExecutionException
     {

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceBundler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceBundler.java?rev=410016&r1=410015&r2=410016&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceBundler.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceBundler.java Sun May 28 20:25:42 2006
@@ -24,6 +24,8 @@
 import java.io.IOException;
 
 /**
+ * Helper class that generates the jar file
+ *
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
  */
@@ -31,6 +33,15 @@
 {
     private static final String[] DEFAULT_INCLUDES = new String[]{"**/*",};
 
+    /**
+     * Method to create an archive of the specified files
+     *
+     * @param outputFile        the destination file of the generated archive
+     * @param sourceDirectories the directory where the files to be archived are located
+     * @param archiver          the archiver object that will create the archive
+     * @throws ArchiverException
+     * @throws IOException
+     */
     public void makeSourceBundle( File outputFile, File[] sourceDirectories, Archiver archiver )
         throws ArchiverException, IOException
     {

Added: maven/plugins/trunk/maven-source-plugin/src/site/apt/configuration.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/apt/configuration.apt?rev=410016&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/site/apt/configuration.apt (added)
+++ maven/plugins/trunk/maven-source-plugin/src/site/apt/configuration.apt Sun May 28 20:25:42 2006
@@ -0,0 +1,45 @@
+ ------
+ Configuring Source Plugin
+ ------
+ Maria Odea Ching
+ ------
+ 26 May 2006
+ ------
+
+How To Use
+
+ The source plugin can be used to create a jar file of the project sources by executing the following command:
+
+--------------------
+mvn source:jar
+--------------------
+
+ A jar file of the test sources can also be generated by executing:
+
+--------------------
+mvn source:test-jar
+--------------------
+
+
+Source Plugin Configuration
+
+ To customize the configuration of the source plugin, you can change the configuration parameters of the plugin in
+ your POM, as shown below:
+
+--------------------
+<project>
+  ...
+  <build>
+    <groupId>org.apache.maven.plugin</groupId>
+    <artifactId>maven-source-plugin</artifactId>
+    <configuration>
+      <outputDirectory>/absolute/path/to/the/output/directory</outputDirectory>
+      <finalName>filename-of-generated-jar-file</finalName>
+      <attach>false</attach>
+    </configuration>
+  </build>
+  ...
+</project>
+--------------------
+
+

Added: maven/plugins/trunk/maven-source-plugin/src/site/apt/introduction.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/apt/introduction.apt?rev=410016&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/site/apt/introduction.apt (added)
+++ maven/plugins/trunk/maven-source-plugin/src/site/apt/introduction.apt Sun May 28 20:25:42 2006
@@ -0,0 +1,15 @@
+ ------
+ Introduction
+ ------
+ Maria Odea Ching
+ ------
+ 26 May 2006
+ ------
+
+
+
+Introduction
+
+ This plugin creates a jar archive of the source files of the project. You can create an archive of the main sources of
+ the project with the source:jar goal. On the other hand, you can use the source:test-jar to generate an archive file
+ of the test sources of the project.

Added: maven/plugins/trunk/maven-source-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/site.xml?rev=410016&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/site/site.xml Sun May 28 20:25:42 2006
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<project name="Maven Source Plugin Report">
+  <bannerLeft>
+    <name>Maven Source Plugin</name>
+    <src>http://maven.apache.org/images/apache-maven-project.png</src>
+    <href>http://maven.apache.org/</href>
+  </bannerLeft>
+  <bannerRight>
+    <src>http://maven.apache.org/images/maven-small.gif</src>
+  </bannerRight>
+  <body>
+    <links>
+      <item name="Maven 2" href="http://maven.apache.org/maven2/"/>
+    </links>
+
+    <menu name="Overview">
+      <item name="Introduction" href="/introduction.html" />              
+      <item name="Configuration" href="/configuration.html"/>
+    </menu>
+    ${reports}
+  </body>
+</project>