MNG-6233 don't mix plexus and jsr330 annotations in aether-provider

Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
This commit is contained in:
Igor Fedorenko 2017-03-28 08:41:38 -04:00
parent 44634982a1
commit 66fc74d629
6 changed files with 19 additions and 34 deletions

View File

@ -62,10 +62,6 @@ under the License.
<groupId>org.apache.maven.resolver</groupId> <groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId> <artifactId>maven-resolver-impl</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.codehaus.plexus</groupId> <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId> <artifactId>plexus-utils</artifactId>
@ -125,8 +121,8 @@ under the License.
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.codehaus.plexus</groupId> <groupId>org.eclipse.sisu</groupId>
<artifactId>plexus-component-metadata</artifactId> <artifactId>sisu-maven-plugin</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>

View File

@ -26,6 +26,7 @@ import java.util.Set;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.maven.model.DistributionManagement; import org.apache.maven.model.DistributionManagement;
@ -39,8 +40,6 @@ import org.apache.maven.model.building.ModelBuildingException;
import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblem; import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.model.resolution.UnresolvableModelException; import org.apache.maven.model.resolution.UnresolvableModelException;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositoryException; import org.eclipse.aether.RepositoryException;
@ -77,31 +76,24 @@ import org.eclipse.aether.transfer.ArtifactNotFoundException;
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
@Named @Named
@Component( role = ArtifactDescriptorReader.class ) @Singleton
public class DefaultArtifactDescriptorReader public class DefaultArtifactDescriptorReader
implements ArtifactDescriptorReader, Service implements ArtifactDescriptorReader, Service
{ {
@SuppressWarnings( "unused" ) @SuppressWarnings( "unused" )
@Requirement( role = LoggerFactory.class )
private Logger logger = NullLoggerFactory.LOGGER; private Logger logger = NullLoggerFactory.LOGGER;
@Requirement
private RemoteRepositoryManager remoteRepositoryManager; private RemoteRepositoryManager remoteRepositoryManager;
@Requirement
private VersionResolver versionResolver; private VersionResolver versionResolver;
@Requirement
private VersionRangeResolver versionRangeResolver; private VersionRangeResolver versionRangeResolver;
@Requirement
private ArtifactResolver artifactResolver; private ArtifactResolver artifactResolver;
@Requirement
private RepositoryEventDispatcher repositoryEventDispatcher; private RepositoryEventDispatcher repositoryEventDispatcher;
@Requirement
private ModelBuilder modelBuilder; private ModelBuilder modelBuilder;
public DefaultArtifactDescriptorReader() public DefaultArtifactDescriptorReader()
@ -117,6 +109,7 @@ public class DefaultArtifactDescriptorReader
{ {
setRemoteRepositoryManager( remoteRepositoryManager ); setRemoteRepositoryManager( remoteRepositoryManager );
setVersionResolver( versionResolver ); setVersionResolver( versionResolver );
setVersionRangeResolver( versionRangeResolver );
setArtifactResolver( artifactResolver ); setArtifactResolver( artifactResolver );
setModelBuilder( modelBuilder ); setModelBuilder( modelBuilder );
setLoggerFactory( loggerFactory ); setLoggerFactory( loggerFactory );

View File

@ -22,8 +22,6 @@ package org.apache.maven.repository.internal;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.maven.artifact.repository.metadata.Versioning; import org.apache.maven.artifact.repository.metadata.Versioning;
import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositoryEvent.EventType; import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RepositorySystemSession;
@ -56,6 +54,7 @@ import org.eclipse.aether.version.VersionScheme;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.inject.Singleton;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.InputStream; import java.io.InputStream;
@ -69,7 +68,7 @@ import java.util.Map;
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
@Named @Named
@Component( role = VersionRangeResolver.class ) @Singleton
public class DefaultVersionRangeResolver public class DefaultVersionRangeResolver
implements VersionRangeResolver, Service implements VersionRangeResolver, Service
{ {
@ -77,16 +76,12 @@ public class DefaultVersionRangeResolver
private static final String MAVEN_METADATA_XML = "maven-metadata.xml"; private static final String MAVEN_METADATA_XML = "maven-metadata.xml";
@SuppressWarnings( "unused" ) @SuppressWarnings( "unused" )
@Requirement( role = LoggerFactory.class )
private Logger logger = NullLoggerFactory.LOGGER; private Logger logger = NullLoggerFactory.LOGGER;
@Requirement
private MetadataResolver metadataResolver; private MetadataResolver metadataResolver;
@Requirement
private SyncContextFactory syncContextFactory; private SyncContextFactory syncContextFactory;
@Requirement
private RepositoryEventDispatcher repositoryEventDispatcher; private RepositoryEventDispatcher repositoryEventDispatcher;
public DefaultVersionRangeResolver() public DefaultVersionRangeResolver()

View File

@ -24,8 +24,6 @@ import org.apache.maven.artifact.repository.metadata.Snapshot;
import org.apache.maven.artifact.repository.metadata.SnapshotVersion; import org.apache.maven.artifact.repository.metadata.SnapshotVersion;
import org.apache.maven.artifact.repository.metadata.Versioning; import org.apache.maven.artifact.repository.metadata.Versioning;
import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.StringUtils;
import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositoryCache;
import org.eclipse.aether.RepositoryEvent; import org.eclipse.aether.RepositoryEvent;
@ -60,6 +58,7 @@ import org.eclipse.aether.util.ConfigUtils;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import javax.inject.Singleton;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -75,7 +74,7 @@ import java.util.Map;
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
@Named @Named
@Component( role = VersionResolver.class ) @Singleton
public class DefaultVersionResolver public class DefaultVersionResolver
implements VersionResolver, Service implements VersionResolver, Service
{ {
@ -89,16 +88,12 @@ public class DefaultVersionResolver
private static final String SNAPSHOT = "SNAPSHOT"; private static final String SNAPSHOT = "SNAPSHOT";
@SuppressWarnings( "unused" ) @SuppressWarnings( "unused" )
@Requirement( role = LoggerFactory.class )
private Logger logger = NullLoggerFactory.LOGGER; private Logger logger = NullLoggerFactory.LOGGER;
@Requirement
private MetadataResolver metadataResolver; private MetadataResolver metadataResolver;
@Requirement
private SyncContextFactory syncContextFactory; private SyncContextFactory syncContextFactory;
@Requirement
private RepositoryEventDispatcher repositoryEventDispatcher; private RepositoryEventDispatcher repositoryEventDispatcher;
public DefaultVersionResolver() public DefaultVersionResolver()

View File

@ -19,7 +19,9 @@ package org.apache.maven.repository.internal;
* under the License. * under the License.
*/ */
import org.codehaus.plexus.component.annotations.Component; import javax.inject.Named;
import javax.inject.Singleton;
import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployRequest;
import org.eclipse.aether.impl.MetadataGenerator; import org.eclipse.aether.impl.MetadataGenerator;
@ -29,7 +31,8 @@ import org.eclipse.aether.installation.InstallRequest;
/** /**
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
@Component( role = MetadataGeneratorFactory.class, hint = "snapshot" ) @Named( "snapshot" )
@Singleton
public class SnapshotMetadataGeneratorFactory public class SnapshotMetadataGeneratorFactory
implements MetadataGeneratorFactory implements MetadataGeneratorFactory
{ {

View File

@ -19,7 +19,9 @@ package org.apache.maven.repository.internal;
* under the License. * under the License.
*/ */
import org.codehaus.plexus.component.annotations.Component; import javax.inject.Named;
import javax.inject.Singleton;
import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.deployment.DeployRequest;
import org.eclipse.aether.impl.MetadataGenerator; import org.eclipse.aether.impl.MetadataGenerator;
@ -29,7 +31,8 @@ import org.eclipse.aether.installation.InstallRequest;
/** /**
* @author Benjamin Bentmann * @author Benjamin Bentmann
*/ */
@Component( role = MetadataGeneratorFactory.class, hint = "versions" ) @Named( "versions" )
@Singleton
public class VersionsMetadataGeneratorFactory public class VersionsMetadataGeneratorFactory
implements MetadataGeneratorFactory implements MetadataGeneratorFactory
{ {