maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r721759 - in /maven/components/trunk/maven-project: ./ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/profiles/ src/main/java/org/apache/maven/profiles/activation/ src/main/java/org/apache/maven/profiles/build/ src/main/java...
Date Sun, 30 Nov 2008 05:18:36 GMT
Author: jvanzyl
Date: Sat Nov 29 21:18:34 2008
New Revision: 721759

URL: http://svn.apache.org/viewvc?rev=721759&view=rev
Log:
o using annos

Modified:
    maven/components/trunk/maven-project/pom.xml
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultMavenProfilesBuilder.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/AlwaysOnProfileActivator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/CustomActivator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/FileProfileActivator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/OperatingSystemProfileActivator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/injection/DefaultProfileInjector.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultRepositoryHelper.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java
    maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml

Modified: maven/components/trunk/maven-project/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/pom.xml?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/pom.xml (original)
+++ maven/components/trunk/maven-project/pom.xml Sat Nov 29 21:18:34 2008
@@ -76,6 +76,10 @@
   </dependencies>
   <build>
     <plugins>
+     <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-metadata</artifactId>
+      </plugin>        
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
Sat Nov 29 21:18:34 2008
@@ -26,7 +26,10 @@
 import org.apache.maven.model.DeploymentRepository;
 import org.apache.maven.model.Repository;
 import org.apache.maven.model.RepositoryPolicy;
+import org.apache.maven.project.MavenProjectBuilder;
 import org.apache.maven.project.MissingRepositoryElementException;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -35,9 +38,11 @@
 /**
  * @author Jason van Zyl
  */
+@Component(role = MavenTools.class)
 public class DefaultMavenTools
     implements MavenTools
 {
+    @Requirement
     private ArtifactRepositoryFactory artifactRepositoryFactory;
 
     // ----------------------------------------------------------------------------

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultMavenProfilesBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultMavenProfilesBuilder.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultMavenProfilesBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/DefaultMavenProfilesBuilder.java
Sat Nov 29 21:18:34 2008
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.ReaderFactory;
@@ -33,6 +34,7 @@
 import java.io.StringReader;
 import java.io.StringWriter;
 
+@Component(role = MavenProfilesBuilder.class)
 public class DefaultMavenProfilesBuilder
     extends AbstractLogEnabled
     implements MavenProfilesBuilder

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/AlwaysOnProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/AlwaysOnProfileActivator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/AlwaysOnProfileActivator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/AlwaysOnProfileActivator.java
Sat Nov 29 21:18:34 2008
@@ -21,7 +21,9 @@
 
 import org.apache.maven.model.Profile;
 import org.apache.maven.profiles.AlwaysOnActivation;
+import org.codehaus.plexus.component.annotations.Component;
 
+@Component(role = ProfileActivator.class, hint = "always-on")
 public class AlwaysOnProfileActivator
     implements ProfileActivator
 {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/CustomActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/CustomActivator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/CustomActivator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/CustomActivator.java
Sat Nov 29 21:18:34 2008
@@ -24,6 +24,8 @@
 import org.apache.maven.model.Profile;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.configurator.BasicComponentConfigurator;
 import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
 import org.codehaus.plexus.component.configurator.ComponentConfigurator;
@@ -44,10 +46,11 @@
  * in configuring the activator. This activator will lookup/configure custom activators on-the-fly,
  * without caching any of the lookups from the container.
  */
+@Component(role = ProfileActivator.class, hint = "custom")
 public class CustomActivator
-    implements ProfileActivator, Contextualizable, LogEnabled
+    implements ProfileActivator, LogEnabled
 {
-
+    @Requirement
     private PlexusContainer container;
 
     private Logger logger;
@@ -125,12 +128,6 @@
         return activator.isActive( profile, context );
     }
 
-    public void contextualize( Context context )
-        throws ContextException
-    {
-        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
-    }
-
     protected Logger getLogger()
     {
         if ( logger == null )

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/FileProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/FileProfileActivator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/FileProfileActivator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/FileProfileActivator.java
Sat Nov 29 21:18:34 2008
@@ -22,6 +22,7 @@
 import org.apache.maven.model.Activation;
 import org.apache.maven.model.ActivationFile;
 import org.apache.maven.model.Profile;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.interpolation.EnvarBasedValueSource;
 import org.codehaus.plexus.interpolation.InterpolationException;
 import org.codehaus.plexus.interpolation.MapBasedValueSource;
@@ -33,6 +34,7 @@
 
 import java.io.IOException;
 
+@Component(role = ProfileActivator.class, hint = "file")
 public class FileProfileActivator
     implements ProfileActivator, LogEnabled
 {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/JdkPrefixProfileActivator.java
Sat Nov 29 21:18:34 2008
@@ -21,12 +21,14 @@
 
 import org.apache.maven.model.Activation;
 import org.apache.maven.model.Profile;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+@Component(role = ProfileActivator.class, hint = "jdk-prefix")
 public class JdkPrefixProfileActivator
     extends DetectedProfileActivator
 {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/OperatingSystemProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/OperatingSystemProfileActivator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/OperatingSystemProfileActivator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/OperatingSystemProfileActivator.java
Sat Nov 29 21:18:34 2008
@@ -22,8 +22,10 @@
 import org.apache.maven.model.Activation;
 import org.apache.maven.model.ActivationOS;
 import org.apache.maven.model.Profile;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.Os;
 
+@Component(role = ProfileActivator.class, hint = "os")
 public class OperatingSystemProfileActivator
     implements ProfileActivator
 {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java
Sat Nov 29 21:18:34 2008
@@ -22,10 +22,12 @@
 import org.apache.maven.model.Activation;
 import org.apache.maven.model.ActivationProperty;
 import org.apache.maven.model.Profile;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.util.Properties;
 
+@Component(role = ProfileActivator.class, hint = "system-property")
 public class SystemPropertyProfileActivator
     extends DetectedProfileActivator
 {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java
Sat Nov 29 21:18:34 2008
@@ -37,6 +37,8 @@
 import org.apache.maven.project.ProjectBuildingException;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.logging.LogEnabled;
@@ -51,18 +53,22 @@
 import java.util.LinkedHashSet;
 import java.util.List;
 
+@Component(role = ProfileAdvisor.class)
 public class DefaultProfileAdvisor
     implements ProfileAdvisor, LogEnabled, Contextualizable
 {
-
     public static final String ROLE_HINT = "default";
 
+    @Requirement
     private MavenTools mavenTools;
 
+    @Requirement
     private MavenProfilesBuilder profilesBuilder;
 
+    @Requirement
     private ProfileInjector profileInjector;
 
+    @Requirement
     private PlexusContainer container;
 
     private Logger logger;
@@ -71,8 +77,6 @@
                                         ProfileActivationContext activationContext )
         throws ProjectBuildingException
     {
-//        logger.debug( "Building profile manager for model: " + model.getId() + " with pom
file: "
-//                      + pomFile );
         ProfileManager profileManager = buildProfileManager( model, pomFile, useProfilesXml,
activationContext );
 
         return applyActivatedProfiles( model, pomFile, profileManager );
@@ -85,10 +89,7 @@
         {
             return Collections.EMPTY_LIST;
         }
-
-//        logger.debug( "Building profile manager for model: " + model.getId()
-//                      + " with external profile manager including profiles: "
-//                      + externalProfileManager.getProfilesById() );
+        
         return applyActivatedProfiles( model, projectDir, externalProfileManager );
     }
 

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/injection/DefaultProfileInjector.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/injection/DefaultProfileInjector.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/injection/DefaultProfileInjector.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/profiles/injection/DefaultProfileInjector.java
Sat Nov 29 21:18:34 2008
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.*;
 import org.apache.maven.project.ModelUtils;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
@@ -46,10 +47,10 @@
  * in the code to justify the extra code involved with separating them, in order to simplify
  * the logic.
  */
+@Component(role = ProfileInjector.class)
 public class DefaultProfileInjector
     implements ProfileInjector
 {
-
     public void inject( Profile profile, Model model )
     {
 
@@ -58,8 +59,6 @@
         injectModules( profile, model );
 
         model.setRepositories( ModelUtils.mergeRepositoryLists( profile.getRepositories(),
model.getRepositories() ) );
-//        model.setPluginRepositories( ModelUtils.mergeRepositoryLists( profile.getPluginRepositories(),
model
-//            .getPluginRepositories() ) );
 
         injectReporting( profile, model );
 

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Sat Nov 29 21:18:34 2008
@@ -44,6 +44,8 @@
 import org.apache.maven.project.builder.*;
 import org.apache.maven.project.validation.ModelValidationResult;
 import org.apache.maven.project.validation.ModelValidator;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -65,29 +67,38 @@
 /**
  * @version $Id$
  */
+@Component(role = MavenProjectBuilder.class)
 public class DefaultMavenProjectBuilder
     implements MavenProjectBuilder, Initializable, LogEnabled
-{    
+{
+    @Requirement
     protected MavenProfilesBuilder profilesBuilder;
 
+    @Requirement
     protected ArtifactResolver artifactResolver;
 
+    @Requirement
     protected ArtifactMetadataSource artifactMetadataSource;
 
+    @Requirement
     private ArtifactFactory artifactFactory;
 
+    @Requirement
     private ModelValidator validator;
 
-    // TODO: make it a component
-    private MavenXpp3Reader modelReader;
-
+    @Requirement
     private ProfileAdvisor profileAdvisor;
 
+    @Requirement
     private MavenTools mavenTools;
 
+    @Requirement
     private ProjectBuilder projectBuilder;
 
+    @Requirement
     private RepositoryHelper repositoryHelper;
+    
+    private MavenXpp3Reader modelReader;
 
     private Logger logger;
 

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
Sat Nov 29 21:18:34 2008
@@ -28,6 +28,8 @@
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.model.Resource;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.File;
@@ -35,11 +37,12 @@
 import java.util.Collections;
 import java.util.List;
 
+@Component(role = MavenProjectHelper.class)
 public class DefaultMavenProjectHelper
     extends AbstractLogEnabled
     implements MavenProjectHelper
 {
-
+    @Requirement
     private ArtifactHandlerManager artifactHandlerManager;
 
     public void attachArtifact( MavenProject project, String artifactType, String artifactClassifier,

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultRepositoryHelper.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultRepositoryHelper.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultRepositoryHelper.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultRepositoryHelper.java
Sat Nov 29 21:18:34 2008
@@ -36,6 +36,8 @@
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.profiles.activation.ProfileActivationContext;
 import org.apache.maven.profiles.build.ProfileAdvisor;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -56,22 +58,26 @@
  * This is a temporary class. These methods are originally from the DefaultMavenProjectHelper.
This class will be
  * eliminated when Mercury is integrated.
  */
+@Component(role = RepositoryHelper.class)
 public class DefaultRepositoryHelper
     implements RepositoryHelper, Initializable, LogEnabled
 {
-
-    private Logger logger;
-
-    public static final String MAVEN_MODEL_VERSION = "4.0.0";
-
+    @Requirement
     private ArtifactFactory artifactFactory;
 
+    @Requirement
     private ArtifactResolver artifactResolver;
 
+    @Requirement
     private MavenTools mavenTools;
 
+    @Requirement
     private ProfileAdvisor profileAdvisor;
+    
+    private Logger logger;
 
+    public static final String MAVEN_MODEL_VERSION = "4.0.0";
+  
     private MavenXpp3Reader modelReader;
 
     private static HashMap<String, Artifact> cache = new HashMap<String, Artifact>();

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Sat Nov 29 21:18:34 2008
@@ -41,6 +41,7 @@
 import org.apache.maven.model.DistributionManagement;
 import org.apache.maven.model.Exclusion;
 import org.apache.maven.model.Relocation;
+import org.apache.maven.profiles.activation.ProfileActivator;
 import org.apache.maven.project.DefaultProjectBuilderConfiguration;
 import org.apache.maven.project.InvalidProjectModelException;
 import org.apache.maven.project.MavenProject;
@@ -49,6 +50,8 @@
 import org.apache.maven.project.validation.ModelValidationResult;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
@@ -64,23 +67,28 @@
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
  */
+@Component(role = ArtifactMetadataSource.class )
 public class MavenMetadataSource
     extends AbstractLogEnabled
     implements ArtifactMetadataSource, Contextualizable
 {
     public static final String ROLE_HINT = "default";
 
-    private MavenProjectBuilder mavenProjectBuilder;
-
+    @Requirement
     private ArtifactFactory artifactFactory;
 
+    @Requirement
     private RepositoryMetadataManager repositoryMetadataManager;
     
     // lazily instantiated and cached.
     private MavenProject superProject;
 
+    @Requirement
     private PlexusContainer container;
 
+    //!! not injected which is a problem
+    private MavenProjectBuilder mavenProjectBuilder;
+
     /**
      * Unfortunately we have projects that are still sending us JARs without the accompanying
POMs.
      */

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/builder/impl/DefaultProjectBuilder.java
Sat Nov 29 21:18:34 2008
@@ -50,32 +50,32 @@
 import org.apache.maven.shared.model.InterpolatorProperty;
 import org.apache.maven.shared.model.ModelEventListener;
 import org.apache.maven.shared.model.ModelTransformerContext;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 
 /**
  * Default implementation of the project builder.
  */
+@Component(role = ProjectBuilder.class)
 public final class DefaultProjectBuilder
     implements ProjectBuilder, LogEnabled
 {
-
+    @Requirement
     private ArtifactFactory artifactFactory;
-
-    /**
-     * Logger instance
-     */
-    private Logger logger;
-
+    
+    @Requirement
     private ModelValidator validator;
 
+    @Requirement
     private MavenTools mavenTools;
        
+    @Requirement
     List<ModelEventListener> listeners;
+
+    private Logger logger;
     
-    /**
-     * Default constructor
-     */
     public DefaultProjectBuilder()
     {
     }

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java
Sat Nov 29 21:18:34 2008
@@ -27,7 +27,9 @@
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Resource;
+import org.codehaus.plexus.component.annotations.Component;
 
+@Component(role = PathTranslator.class)
 public class DefaultPathTranslator
     implements PathTranslator
 {

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java
Sat Nov 29 21:18:34 2008
@@ -30,6 +30,8 @@
 import org.apache.maven.model.Reporting;
 import org.apache.maven.model.Repository;
 import org.apache.maven.model.Resource;
+import org.apache.maven.profiles.activation.ProfileActivator;
+import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
@@ -40,14 +42,12 @@
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
  */
+@Component(role = ModelValidator.class )
 public class DefaultModelValidator
     implements ModelValidator
 {
     private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
 
-    ///////////////////////////////////////////////////////////////////////////
-    // ModelValidator Implementation
-
     public ModelValidationResult validate( Model model )
     {
         ModelValidationResult result = new ModelValidationResult();

Modified: maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml?rev=721759&r1=721758&r2=721759&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
Sat Nov 29 21:18:34 2008
@@ -18,260 +18,6 @@
 -->
 
 <component-set>
-  <components>
-
-    <component>
-      <role>org.apache.maven.project.path.PathTranslator</role>
-      <implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
-    </component>      
-
-    <component>
-      <role>org.apache.maven.profiles.MavenProfilesBuilder</role>
-      <implementation>org.apache.maven.profiles.DefaultMavenProfilesBuilder</implementation>
-    </component>  
-  
-    <component>
-      <role>org.apache.maven.profiles.build.ProfileAdvisor</role>
-      <role-hint>default</role-hint>
-      <implementation>org.apache.maven.profiles.build.DefaultProfileAdvisor</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.MavenTools</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.profiles.MavenProfilesBuilder</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.profiles.injection.ProfileInjector</role>
-        </requirement>
-      </requirements>
-    </component>
-    
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.project.MavenProjectHelper</role>
-      <implementation>org.apache.maven.project.DefaultMavenProjectHelper</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
-        </requirement>
-      </requirements>
-    </component>
-
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.injection.ProfileInjector</role>
-      <implementation>org.apache.maven.profiles.injection.DefaultProfileInjector</implementation>
-    </component>
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-        <role>org.apache.maven.project.builder.ProjectBuilder</role>
-        <role-hint>default</role-hint>
-        <implementation>org.apache.maven.project.builder.impl.DefaultProjectBuilder</implementation>
-        <requirements>
-            <requirement>
-                <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-            </requirement>
-            <requirement>
-              <role>org.apache.maven.MavenTools</role>
-            </requirement>
-        </requirements>
-    </component>
-    <component>
-      <role>org.apache.maven.project.MavenProjectBuilder</role>
-      <role-hint>default</role-hint>
-      <implementation>org.apache.maven.project.DefaultMavenProjectBuilder</implementation>
-      <requirements>
-        <requirement>
-             <role>org.apache.maven.project.RepositoryHelper</role>
-        </requirement>             
-        <requirement>
-             <role>org.apache.maven.project.builder.ProjectBuilder</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.profiles.build.ProfileAdvisor</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.profiles.MavenProfilesBuilder</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.project.validation.ModelValidator</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
-          <role-hint>default</role-hint>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.MavenTools</role>
-        </requirement>
-      </requirements>
-    </component>
-
-<!--Eliminate this component after Mercury Integration-->      
-    <component>
-      <role>org.apache.maven.project.RepositoryHelper</role>
-      <implementation>org.apache.maven.project.DefaultRepositoryHelper</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.profiles.build.ProfileAdvisor</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
-          <role-hint>default</role-hint>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.MavenTools</role>
-        </requirement>
-      </requirements>
-    </component>
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.activation.ProfileActivator</role>
-      <role-hint>always-on</role-hint>
-      <implementation>org.apache.maven.profiles.activation.AlwaysOnProfileActivator</implementation>
-    </component>
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.activation.ProfileActivator</role>
-      <role-hint>jdk-prefix</role-hint>
-      <implementation>org.apache.maven.profiles.activation.JdkPrefixProfileActivator</implementation>
-    </component>
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.activation.ProfileActivator</role>
-      <role-hint>system-property</role-hint>
-      <implementation>org.apache.maven.profiles.activation.SystemPropertyProfileActivator</implementation>
-    </component>
-    <!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.activation.ProfileActivator</role>
-      <role-hint>os</role-hint>
-      <implementation>org.apache.maven.profiles.activation.OperatingSystemProfileActivator</implementation>
-    </component>
-    <!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.activation.ProfileActivator</role>
-      <role-hint>file</role-hint>
-      <implementation>org.apache.maven.profiles.activation.FileProfileActivator</implementation>
-    </component>
-    <!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.profiles.activation.ProfileActivator</role>
-      <role-hint>custom</role-hint>
-      <implementation>org.apache.maven.profiles.activation.CustomActivator</implementation>
-    </component>
-<!--
-     |
-     |
-     |
-     -->
-    <component>
-      <role>org.apache.maven.project.validation.ModelValidator</role>
-      <implementation>org.apache.maven.project.validation.DefaultModelValidator</implementation>
-    </component>
-
-<!-- ********************* FIXME *******************************************
-| I realize this is duplicated but allows the project builder to work by itself
--->
-
-    <component>
-      <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
-      <role-hint>maven</role-hint>
-      <implementation>org.apache.maven.project.artifact.MavenMetadataSource</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
-      <role-hint>maven-strict</role-hint>
-      <implementation>org.apache.maven.project.artifact.MavenMetadataSource</implementation>
-      <configuration>
-        <strictlyEnforceThePresenceOfAValidMavenPOM>true</strictlyEnforceThePresenceOfAValidMavenPOM>
-      </configuration>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
-      <role-hint>default</role-hint>
-      <implementation>org.apache.maven.project.artifact.MavenMetadataSource</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.apache.maven.MavenTools</role>
-      <implementation>org.apache.maven.DefaultMavenTools</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
-        </requirement>
-      </requirements>
-    </component>    
+  <components>  
   </components>
 </component-set>



Mime
View raw message