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/07/28 09:13:27 UTC
svn commit: r426417 - in /maven/plugins/trunk/maven-plugin-plugin: ./
src/main/java/org/apache/maven/plugin/plugin/
src/main/java/org/apache/maven/plugin/plugin/metadata/ src/site/
src/site/apt/ src/site/fml/
Author: oching
Date: Fri Jul 28 00:13:26 2006
New Revision: 426417
URL: http://svn.apache.org/viewvc?rev=426417&view=rev
Log:
PR: MPLUGIN-23
Added documentation for the plugin.
Added:
maven/plugins/trunk/maven-plugin-plugin/src/site/apt/index.apt
maven/plugins/trunk/maven-plugin-plugin/src/site/apt/usage.apt
maven/plugins/trunk/maven-plugin-plugin/src/site/fml/
maven/plugins/trunk/maven-plugin-plugin/src/site/fml/faq.fml
maven/plugins/trunk/maven-plugin-plugin/src/site/site.xml
Modified:
maven/plugins/trunk/maven-plugin-plugin/pom.xml
maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java
maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java
maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java
Modified: maven/plugins/trunk/maven-plugin-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/pom.xml?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-plugin-plugin/pom.xml Fri Jul 28 00:13:26 2006
@@ -2,7 +2,7 @@
<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-plugin-plugin</artifactId>
Modified: maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java (original)
+++ maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java Fri Jul 28 00:13:26 2006
@@ -1,7 +1,7 @@
package org.apache.maven.plugin.plugin;
/*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-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.
@@ -37,12 +37,16 @@
extends AbstractMojo
{
/**
+ * The project currently being built.
+ *
* @parameter expression="${project}"
* @required
*/
protected MavenProject project;
/**
+ * The component used for scanning the source tree for mojos.
+ *
* @parameter expression="${component.org.apache.maven.tools.plugin.scanner.MojoScanner}"
* @required
*/
Modified: maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java (original)
+++ maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojo.java Fri Jul 28 00:13:26 2006
@@ -1,7 +1,7 @@
package org.apache.maven.plugin.plugin;
/*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-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.
@@ -35,6 +35,8 @@
extends AbstractGeneratorMojo
{
/**
+ * The directory where the generated plugin.xml file will be put.
+ *
* @parameter expression="${project.build.outputDirectory}/META-INF/maven"
* @required
*/
Modified: maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java (original)
+++ maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java Fri Jul 28 00:13:26 2006
@@ -1,7 +1,7 @@
package org.apache.maven.plugin.plugin;
/*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-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.
@@ -272,4 +272,4 @@
endSection();
}
}
-}
\ No newline at end of file
+}
Modified: maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java (original)
+++ maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/UpdatePluginRegistryMojo.java Fri Jul 28 00:13:26 2006
@@ -1,7 +1,7 @@
package org.apache.maven.plugin.plugin;
/*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-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.
@@ -45,6 +45,9 @@
{
/**
+ * Indicates whether the plugin-registry.xml is used by Maven or not
+ * to manage plugin versions.
+ *
* @parameter default-value="${settings.usePluginRegistry}"
* @required
* @readonly
@@ -52,6 +55,8 @@
private boolean usePluginRegistry;
/**
+ * The group id of the project currently being built.
+ *
* @parameter default-value="${project.groupId}"
* @required
* @readonly
@@ -59,6 +64,8 @@
private String groupId;
/**
+ * The artifact id of the project currently being built.
+ *
* @parameter default-value="${project.artifactId}"
* @required
* @readonly
@@ -66,6 +73,8 @@
private String artifactId;
/**
+ * The version of the project currently being built.
+ *
* @parameter default-value="${project.artifact.version}"
* @required
* @readonly
Modified: maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java (original)
+++ maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java Fri Jul 28 00:13:26 2006
@@ -1,7 +1,7 @@
package org.apache.maven.plugin.plugin;
/*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2001-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.
@@ -22,6 +22,8 @@
import java.io.File;
/**
+ * Generate Xdoc files for the project mojos or goals
+ *
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @version $Id$
* @goal xdoc
@@ -30,6 +32,8 @@
extends AbstractGeneratorMojo
{
/**
+ * The directory where the generated Xdoc files will be put.
+ *
* @parameter expression="${project.build.directory}/generated-site/xdoc"
* @required
*/
Modified: maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java?rev=426417&r1=426416&r2=426417&view=diff
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java (original)
+++ maven/plugins/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/metadata/AddPluginArtifactMetadataMojo.java Fri Jul 28 00:13:26 2006
@@ -1,5 +1,21 @@
package org.apache.maven.plugin.plugin.metadata;
+/*
+ * Copyright 2001-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.
+ */
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata;
import org.apache.maven.artifact.repository.metadata.GroupRepositoryMetadata;
@@ -31,6 +47,8 @@
private MavenProject project;
/**
+ * The prefix for the plugin goal.
+ *
* @parameter
*/
private String goalPrefix;
Added: maven/plugins/trunk/maven-plugin-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/site/apt/index.apt?rev=426417&view=auto
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-plugin-plugin/src/site/apt/index.apt Fri Jul 28 00:13:26 2006
@@ -0,0 +1,43 @@
+ ------
+ Introduction
+ ------
+ Maria Odea Ching
+ ------
+ 27 July 2006
+ ------
+
+
+Maven 2 Plugin Plugin
+
+ The Plugin Plugin is used to create a Maven plugin descriptor for any Mojo's found in the source tree, to include in the JAR.
+ It is also used to generate Xdoc files for the Mojos as well as for updating the plugin registry and the artifact metadata.
+
+* Goals Overview
+
+ The Plugin Plugin has four goals:
+
+ * {{{descriptor-mojo.html}plugin:descriptor}} generates a plugin descriptor.
+
+ * {{{updateRegistry-mojo.html}plugin:updateRegistry}} updates the user plugin registry (if it's in use) to reflect the
+ version being installed.
+
+ * {{{xdoc-mojo.html}plugin:xdoc}} generates Xdoc files for the project mojos or goals.
+
+ * {{{addPluginArtifactMetadata-mojo.html}plugin:addPluginArtifactMetadata}} injects any plugin-specific artifact metadata to the project's
+ artifact, for subsequent installation and deployment. The first use-case for this is to add the LATEST metadata
+ (which is plugin-specific) for shipping alongside the plugin's artifact.
+
+* Usage
+
+ Instructions on how to use the Plugin Plugin can be found {{{usage.html}here}}.
+
+* Examples
+
+ The following example shows how to use the Plugin Plugin in more advanced usecases:
+
+ * {{{examples/generate-descriptor.html}Configuring Generation of Plugin Descriptor}}
+
+
+
+
+
Added: maven/plugins/trunk/maven-plugin-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/site/apt/usage.apt?rev=426417&view=auto
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/site/apt/usage.apt (added)
+++ maven/plugins/trunk/maven-plugin-plugin/src/site/apt/usage.apt Fri Jul 28 00:13:26 2006
@@ -0,0 +1,74 @@
+ ------
+ Usage
+ ------
+ Maria Odea Ching
+ ------
+ 27 July 2006
+ ------
+
+
+Usage
+
+ The Plugin Plugin is generally used for Maven 2 plugins. Its mojos are bound to different phases in the build life cycle.
+ So when you execute a specific phase, the Plugin Plugin mojos bound to it are also executed. Aside from this, each goal can
+ also be explicitly executed from the command line.
+
+* The <<<plugin:descriptor>>> Goal
+
+ The <<<plugin:descriptor>>> goal is bound to the <<<generate-resources>>> phase. This goal generates the plugin descriptor, which
+ is an xml file that contains information about the plugin.
+
+ For example, you want to create an archive of your plugin and you execute
+
++-----+
+mvn package
++-----+
+
+ You will see that the plugin.xml file is generated in the target/classes/META-INF/maven directory of your project. The file is
+ also bundled in the generated jar file.
+
+ To explicitly execute the <<<plugin:descriptor>>> goal, type the following in the command line:
+
++-----+
+mvn plugin:descriptor
++-----+
+
+* The <<<plugin:xdoc>>> Goal
+
+ To generate Xdoc files for the mojos of your plugin, execute the following on the command line:
+
++-----+
+mvn plugin:xdoc
++-----+
+
+* The <<<plugin:updateRegistry>>> Goal
+
+ The <<<plugin:updateRegistry>>> goal is bound to the <<<install>>> phase of the build life cycle. This goal updates the
+ plugin registry to reflect the changes in the version of the plugin you're installing in your local repository.
+
+ So when you execute
+
++-----+
+mvn install
++-----+
+
+ you will see that the version of the plugin in the plugin-registry.xml is changed to the same version of that plugin
+ you have just installed.
+
+ You can also explicitly execute the <<<plugin:updateRegistry>>> goal by executing
+
++-----+
+mvn plugin:updateRegistry
++-----+
+
+ from the command line.
+
+* The <<<plugin:addPluginArtifactMetadata>>> Goal
+
+ The <<<plugin:addPluginArtifactMetadata>>> goal, on the other hand, is bound to the <<<package>>> phase of the build life cycle.
+ This goal will add the metadata to the project artifact. To do this, execute
+
++-----+
+mvn package
++-----+
+
Added: maven/plugins/trunk/maven-plugin-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/site/fml/faq.fml?rev=426417&view=auto
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/site/fml/faq.fml (added)
+++ maven/plugins/trunk/maven-plugin-plugin/src/site/fml/faq.fml Fri Jul 28 00:13:26 2006
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<faqs id="FAQ" title="Frequently Asked Questions">
+ <part id="General">
+ <faq id="Where is the plugin-registry.xml">
+ <question>Where is the plugin-registry.xml?</question>
+ <answer>
+ <p>
+ The plugin-registry.xml file can be found in the M2 repository, inside the .m2 directory. It contains the
+ list of the plugins installed in your repository including the last version installed.
+ </p>
+ </answer>
+ </faq>
+ </part>
+</faqs>
\ No newline at end of file
Added: maven/plugins/trunk/maven-plugin-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-plugin-plugin/src/site/site.xml?rev=426417&view=auto
==============================================================================
--- maven/plugins/trunk/maven-plugin-plugin/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-plugin-plugin/src/site/site.xml Fri Jul 28 00:13:26 2006
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+/*
+ * Copyright 2001-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 Plugin Plugin">
+ <bannerLeft>
+ <name>Maven Plugin 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="index.html"/>
+ <item name="Usage" href="usage.html"/>
+ <item name="Goals" href="plugin-info.html"/>
+ <item name="FAQ" href="faq.html"/>
+ <item name="Multiple Language Support: Redesign Notes" href="multiple-language-support.html"/>
+ </menu>
+ <menu name="Examples">
+ <item name="Configuring Generation of Plugin Descriptor" href="/examples/generate-descriptor.html"/>
+ </menu>
+ ${reports}
+ </body>
+</project>