o Used component annotations where possible

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@944865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-05-16 15:43:21 +00:00
parent dca7e1fffe
commit 1cadde7468
3 changed files with 7 additions and 40 deletions

View File

@ -14,6 +14,8 @@
*/ */
package org.apache.maven.lifecycle; package org.apache.maven.lifecycle;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.StringUtils;
@ -32,14 +34,17 @@ import java.util.Set;
*/ */
// TODO: The configuration for the lifecycle needs to be externalized so that I can use the annotations properly for the // TODO: The configuration for the lifecycle needs to be externalized so that I can use the annotations properly for the
// wiring and reference and external source for the lifecycle configuration. // wiring and reference and external source for the lifecycle configuration.
@Component( role = DefaultLifecycles.class )
public class DefaultLifecycles public class DefaultLifecycles
{ {
public static final String[] STANDARD_LIFECYCLES = { "default", "clean", "site" }; public static final String[] STANDARD_LIFECYCLES = { "default", "clean", "site" };
// @Configuration(source="org/apache/maven/lifecycle/lifecycles.xml") // @Configuration(source="org/apache/maven/lifecycle/lifecycles.xml")
@Requirement( role = Lifecycle.class )
private Map<String, Lifecycle> lifecycles; private Map<String, Lifecycle> lifecycles;
@Requirement
private Logger logger; private Logger logger;
@SuppressWarnings( { "UnusedDeclaration" } ) @SuppressWarnings( { "UnusedDeclaration" } )

View File

@ -41,7 +41,8 @@ import java.util.Set;
public class LifecyclePluginAnalyzerImpl public class LifecyclePluginAnalyzerImpl
implements LifeCyclePluginAnalyzer implements LifeCyclePluginAnalyzer
{ {
@Requirement
@Requirement( role = LifecycleMapping.class )
private Map<String, LifecycleMapping> lifecycleMappings; private Map<String, LifecycleMapping> lifecycleMappings;
@Requirement @Requirement
@ -50,7 +51,6 @@ public class LifecyclePluginAnalyzerImpl
@Requirement @Requirement
private Logger logger; private Logger logger;
public LifecyclePluginAnalyzerImpl() public LifecyclePluginAnalyzerImpl()
{ {
} }

View File

@ -17,26 +17,6 @@
--> -->
<component-set> <component-set>
<components> <components>
<component>
<role>org.apache.maven.plugin.MavenPluginCollector</role>
<implementation>org.apache.maven.plugin.MavenPluginCollector
</implementation>
</component>
<component>
<role>org.apache.maven.lifecycle.DefaultLifecycles</role>
<implementation>org.apache.maven.lifecycle.DefaultLifecycles</implementation>
<requirements>
<requirement>
<role>org.codehaus.plexus.logging.Logger</role>
<field-name>logger</field-name>
</requirement>
<requirement>
<role>org.apache.maven.lifecycle.Lifecycle</role>
<field-name>lifecycles</field-name>
</requirement>
</requirements>
</component>
<component> <component>
<role>org.apache.maven.lifecycle.DefaultSchedules</role> <role>org.apache.maven.lifecycle.DefaultSchedules</role>
<implementation>org.apache.maven.lifecycle.DefaultSchedules</implementation> <implementation>org.apache.maven.lifecycle.DefaultSchedules</implementation>
@ -141,24 +121,6 @@
</default-phases> </default-phases>
</configuration> </configuration>
</component> </component>
<component>
<role>org.apache.maven.lifecycle.LifeCyclePluginAnalyzer</role>
<implementation>org.apache.maven.lifecycle.internal.LifecyclePluginAnalyzerImpl</implementation>
<requirements>
<requirement>
<role>org.apache.maven.lifecycle.DefaultLifecycles</role>
</requirement>
<requirement>
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
<field-name>lifecycleMappings</field-name>
</requirement>
<requirement>
<role>org.codehaus.plexus.logging.Logger</role>
<role-hint>default</role-hint>
<field-name>logger</field-name>
</requirement>
</requirements>
</component>
<component> <component>
<role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher