Author: oching Date: Tue Jul 11 00:01:47 2006 New Revision: 420743 URL: http://svn.apache.org/viewvc?rev=420743&view=rev Log: PR: MSOURCES-9
Revised and added plugin documentation. Added: maven/plugins/trunk/maven-source-plugin/src/site/apt/examples/ maven/plugins/trunk/maven-source-plugin/src/site/apt/examples/configureplugin.apt maven/plugins/trunk/maven-source-plugin/src/site/apt/index.apt maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt maven/plugins/trunk/maven-source-plugin/src/site/fml/ maven/plugins/trunk/maven-source-plugin/src/site/fml/faq.fml Removed: maven/plugins/trunk/maven-source-plugin/src/site/apt/configuration.apt maven/plugins/trunk/maven-source-plugin/src/site/apt/introduction.apt Modified: maven/plugins/trunk/maven-source-plugin/pom.xml 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/SourceBundler.java maven/plugins/trunk/maven-source-plugin/src/site/site.xml Modified: maven/plugins/trunk/maven-source-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/pom.xml?rev=420743&r1=420742&r2=420743&view=diff ============================================================================== --- maven/plugins/trunk/maven-source-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-source-plugin/pom.xml Tue Jul 11 00:01:47 2006 @@ -2,13 +2,16 @@ <parent> <artifactId>maven-plugins</artifactId> <groupId>org.apache.maven.plugins</groupId> - <version>1</version> + <version>2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>maven-source-plugin</artifactId> <packaging>maven-plugin</packaging> <name>Maven Source Plug-In</name> <version>2.0.2-SNAPSHOT</version> + <prerequisites> + <maven>2.0</maven> + </prerequisites> <dependencies> <dependency> <groupId>org.apache.maven</groupId> 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=420743&r1=420742&r2=420743&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 Tue Jul 11 00:01:47 2006 @@ -1,7 +1,7 @@ package org.apache.maven.plugin.source; /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-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. @@ -47,6 +47,8 @@ protected String packaging; /** + * The project where the plugin is currently being executed. + * * @parameter expression="${executedProject}" * @required */ @@ -82,6 +84,9 @@ */ protected String finalName; + /** + * @see org.apache.maven.plugin.AbstractMojo#execute() + */ public abstract 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=420743&r1=420742&r2=420743&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 Tue Jul 11 00:01:47 2006 @@ -1,7 +1,7 @@ package org.apache.maven.plugin.source; /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-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. Added: maven/plugins/trunk/maven-source-plugin/src/site/apt/examples/configureplugin.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/apt/examples/configureplugin.apt?rev=420743&view=auto ============================================================================== --- maven/plugins/trunk/maven-source-plugin/src/site/apt/examples/configureplugin.apt (added) +++ maven/plugins/trunk/maven-source-plugin/src/site/apt/examples/configureplugin.apt Tue Jul 11 00:01:47 2006 @@ -0,0 +1,32 @@ + ------ + Configuring Source Plugin + ------ + Maria Odea Ching + ------ + 11 July 2006 + ------ + +Configuring Source Plugin + + To customize the configuration of the plugin, you can change its configuration parameters 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> ++-----+ + + The generated jar file will hold the value of the <<<finalName>>> plus "-sources" if it is the main sources. Otherwise, + it would be <<<finalName>>> plus "-test-sources" if it is the test sources. It would be generated in the specified + <<<outputDirectory>>>. The <<<attach>>> parameter specifies that the produced jar file will be attached to the project + artifact. Added: maven/plugins/trunk/maven-source-plugin/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/apt/index.apt?rev=420743&view=auto ============================================================================== --- maven/plugins/trunk/maven-source-plugin/src/site/apt/index.apt (added) +++ maven/plugins/trunk/maven-source-plugin/src/site/apt/index.apt Tue Jul 11 00:01:47 2006 @@ -0,0 +1,35 @@ + ------ + Introduction + ------ + Maria Odea Ching + ------ + 11 July 2006 + ------ + + +Maven 2 Source Plugin + + The Maven 2 Source Plugin creates a jar archive of the source files of the current project. The jar file is, by default, + generated in the project's target directory. + +* Goals Overview + + The Source Plugin has two goals: + + * {{{jar-mojo.html}source:jar}} is used to bundle the main sources of the project into a jar file. + + * {{{test-jar-mojo.html}source:test-jar}} on the other hand, is used to bundle the test sources of the project into a + jar archive. + +* Usage + + Instructions on how to use the Source Plugin can be found {{{usage.html}here}}. + +* Examples + + To provide you with better understanding on some usages of the Source plugin, you can take a look into the + following examples: + + * {{{examples/configureplugin.html}Configuring Source Plugin}} + + Added: 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=420743&view=auto ============================================================================== --- maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt (added) +++ maven/plugins/trunk/maven-source-plugin/src/site/apt/usage.apt Tue Jul 11 00:01:47 2006 @@ -0,0 +1,23 @@ + ------ + Usage + ------ + Maria Odea Ching + ------ + 11 July 2006 + ------ + +Usage + + 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 ++-----+ + + Added: maven/plugins/trunk/maven-source-plugin/src/site/fml/faq.fml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/site/fml/faq.fml?rev=420743&view=auto ============================================================================== --- maven/plugins/trunk/maven-source-plugin/src/site/fml/faq.fml (added) +++ maven/plugins/trunk/maven-source-plugin/src/site/fml/faq.fml Tue Jul 11 00:01:47 2006 @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<faqs id="FAQ" title="Frequently Asked Questions"> + <part id="General"> + <faq id="1"> + <question></question> + <answer> + <p> + </p> + </answer> + </faq> + </part> +</faqs> \ No newline at end of file Modified: 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=420743&r1=420742&r2=420743&view=diff ============================================================================== --- maven/plugins/trunk/maven-source-plugin/src/site/site.xml (original) +++ maven/plugins/trunk/maven-source-plugin/src/site/site.xml Tue Jul 11 00:01:47 2006 @@ -33,8 +33,14 @@ </links> <menu name="Overview"> - <item name="Introduction" href="/introduction.html" /> - <item name="Configuration" href="/configuration.html"/> + <item name="Introduction" href="index.html"/> + <item name="Goals" href="plugin-info.html"/> + <item name="Usage" href="usage.html"/> + <!--item name="FAQ" href="faq.html"/--> + </menu> + + <menu name="Examples"> + <item name="Configuring Source Plugin" href="/examples/configureplugin.html"/> </menu> ${reports} </body>