o load all pluginRelocators with plexus

o auto-generate components.xml

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@423516 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2006-07-19 16:34:10 +00:00
parent 7c69847387
commit cdfe08509e
17 changed files with 54 additions and 47 deletions

View File

@ -52,4 +52,19 @@
<version>1.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -17,17 +17,6 @@ package org.apache.maven.model.converter;
*/
import org.apache.maven.model.Model;
import org.apache.maven.model.converter.plugins.PCCChangelog;
import org.apache.maven.model.converter.plugins.PCCChanges;
import org.apache.maven.model.converter.plugins.PCCCheckstyle;
import org.apache.maven.model.converter.plugins.PCCCompiler;
import org.apache.maven.model.converter.plugins.PCCJar;
import org.apache.maven.model.converter.plugins.PCCJavadoc;
import org.apache.maven.model.converter.plugins.PCCMultiproject;
import org.apache.maven.model.converter.plugins.PCCPmd;
import org.apache.maven.model.converter.plugins.PCCSurefire;
import org.apache.maven.model.converter.plugins.PCCTaglist;
import org.apache.maven.model.converter.plugins.PCCWar;
import org.apache.maven.model.converter.plugins.PluginConfigurationConverter;
import org.apache.maven.model.converter.relocators.PluginRelocator;
import org.apache.maven.model.converter.relocators.PluginRelocatorManager;
@ -48,6 +37,7 @@ import java.io.InputStream;
import java.io.Writer;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
/**
@ -56,6 +46,7 @@ import java.util.Properties;
* @author Fabrizio Giustina
* @author Dennis Lundberg
* @version $Id$
* @plexus.component role="org.apache.maven.model.converter.Maven1Converter"
*/
public class Maven1Converter
extends AbstractLogEnabled
@ -64,10 +55,10 @@ public class Maven1Converter
/**
* Available converters for specific plugin configurations
*
* @plexus.requirement role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter"
*/
private PluginConfigurationConverter[] converters = new PluginConfigurationConverter[]{new PCCChangelog(),
new PCCChanges(), new PCCCheckstyle(), new PCCCompiler(), new PCCJar(), new PCCJavadoc(), new PCCMultiproject(),
new PCCPmd(), new PCCSurefire(), new PCCTaglist(), new PCCWar()};
private List converters;
/**
* Plexus component that manages plugin relocators
@ -120,9 +111,10 @@ public class Maven1Converter
loadProperties( properties, new File( basedir, "project.properties" ) );
for ( int j = 0; j < converters.length; j++ )
for ( Iterator i = converters.iterator(); i.hasNext(); )
{
converters[j].convertConfiguration( v4Model, v3Model, properties );
PluginConfigurationConverter converter = (PluginConfigurationConverter) i.next();
converter.convertConfiguration( v4Model, v3Model, properties );
}
// @todo Should this be run before or after the configuration converters?

View File

@ -44,6 +44,7 @@ import java.util.Properties;
/**
* @author jdcasey
* @plexus.component role="org.apache.maven.model.converter.ModelConverter"
*/
public class PomV3ToV4Translator
implements ModelConverter

View File

@ -30,10 +30,14 @@ import java.util.List;
/**
* @author jdcasey
* @plexus.component role="org.apache.maven.model.converter.ArtifactPomRewriter" role-hint="v3"
*/
public class V3PomRewriter
implements ArtifactPomRewriter
{
/**
* @plexus.requirement
*/
private ModelConverter translator;
public void rewrite( Reader from, Writer to, boolean reportOnly, String groupId, String artifactId, String version,

View File

@ -22,15 +22,18 @@ import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import java.io.Reader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
/**
* @author jdcasey
* @plexus.component role="org.apache.maven.model.converter.ArtifactPomRewriter" role-hint="v4"
*/
public class V4PomRewriter
implements ArtifactPomRewriter
{
/**
* @plexus.requirement
*/
private ModelConverter translator;
public void rewrite( Reader from, Writer to, boolean reportOnly, String groupId, String artifactId, String version,

View File

@ -24,6 +24,8 @@ import java.util.Properties;
/**
* A <code>PluginConfigurationConverter</code> for the maven-changelog-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="changelog"
*
* @author Dennis Lundberg
* @version $Id: PCCChangelog.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -24,6 +24,8 @@ import java.util.Properties;
/**
* A <code>PluginConfigurationConverter</code> for the maven-changes-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="changes"
*
* @author Dennis Lundberg
* @version $Id: PCCChanges.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -24,6 +24,8 @@ import java.util.Properties;
/**
* A <code>PluginConfigurationConverter</code> for the maven-checkstyle-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="checkstyle"
*
* @author Dennis Lundberg
* @version $Id: PCCCheckstyle.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -22,6 +22,8 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.util.Properties;
/**
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="compiler"
*
* @author Fabrizio Giustina
* @author Dennis Lundberg
* @version $Id$

View File

@ -25,6 +25,8 @@ import java.util.StringTokenizer;
/**
* A <code>PluginConfigurationConverter</code> for the maven-jar-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="jar"
*
* @author Dennis Lundberg
* @version $Id: PCCJar.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -25,6 +25,8 @@ import java.util.StringTokenizer;
/**
* A <code>PluginConfigurationConverter</code> for the maven-javadoc-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="javadoc"
*
* @author Dennis Lundberg
* @version $Id: PCCJavadoc.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -22,6 +22,8 @@ import org.apache.maven.model.converter.ProjectConverterException;
import java.util.Properties;
/**
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="multiproject"
*
* @author Fabrizio Giustina
* @version $Id$
*/

View File

@ -25,6 +25,8 @@ import java.util.StringTokenizer;
/**
* A <code>PluginConfigurationConverter</code> for the maven-pmd-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="pmd"
*
* @author Dennis Lundberg
* @version $Id: PCCPmd.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -25,6 +25,8 @@ import java.util.Properties;
import java.util.StringTokenizer;
/**
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="surefire"
*
* @author Fabrizio Giustina
* @author Dennis Lundberg
* @version $Id$

View File

@ -24,6 +24,8 @@ import java.util.Properties;
/**
* A <code>PluginConfigurationConverter</code> for the maven-tasklist-plugin.
*
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="taglist"
*
* @author Dennis Lundberg
* @version $Id: PCCTaglist.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 2006) carlos $
*/

View File

@ -23,6 +23,8 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.util.Properties;
/**
* @plexus.component role="org.apache.maven.model.converter.plugins.PluginConfigurationConverter" role-hint="war"
*
* @author Fabrizio Giustina
* @author Dennis Lundberg
* @version $Id$

View File

@ -1,30 +0,0 @@
<component-set>
<components>
<component>
<role>org.apache.maven.model.converter.ArtifactPomRewriter</role>
<role-hint>v3</role-hint>
<implementation>org.apache.maven.model.converter.V3PomRewriter</implementation>
<requirements>
<requirement>
<role>org.apache.maven.model.converter.ModelConverter</role>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.model.converter.ArtifactPomRewriter</role>
<role-hint>v4</role-hint>
<implementation>org.apache.maven.model.converter.V4PomRewriter</implementation>
<requirements>
<requirement>
<role>org.apache.maven.model.converter.ModelConverter</role>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.model.converter.ModelConverter</role>
<implementation>org.apache.maven.model.converter.PomV3ToV4Translator</implementation>
</component>
</components>
</component-set>