Adding a small comment about managed artifact versions in here.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@549970 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2007-06-22 22:09:22 +00:00
parent fda3badc24
commit f479a38620
1 changed files with 8 additions and 7 deletions

View File

@ -68,7 +68,7 @@ public class DefaultExtensionManager
private PlexusContainer container; private PlexusContainer container;
private ArtifactFilterManager artifactFilterManager; private ArtifactFilterManager artifactFilterManager;
private WagonManager wagonManager; private WagonManager wagonManager;
public void addExtension( Extension extension, public void addExtension( Extension extension,
@ -84,7 +84,7 @@ public class DefaultExtensionManager
Parent originatingParent = originatingModel.getParent(); Parent originatingParent = originatingModel.getParent();
String groupId = originatingModel.getGroupId(); String groupId = originatingModel.getGroupId();
if ( groupId == null && originatingParent != null ) if ( ( groupId == null ) && ( originatingParent != null ) )
{ {
groupId = originatingParent.getGroupId(); groupId = originatingParent.getGroupId();
} }
@ -92,7 +92,7 @@ public class DefaultExtensionManager
String artifactId = originatingModel.getArtifactId(); String artifactId = originatingModel.getArtifactId();
String version = originatingModel.getVersion(); String version = originatingModel.getVersion();
if ( version == null && originatingParent != null ) if ( ( version == null ) && ( originatingParent != null ) )
{ {
version = originatingParent.getVersion(); version = originatingParent.getVersion();
} }
@ -124,12 +124,13 @@ public class DefaultExtensionManager
throws ArtifactResolutionException, PlexusContainerException, ArtifactNotFoundException throws ArtifactResolutionException, PlexusContainerException, ArtifactNotFoundException
{ {
getLogger().debug( "Starting extension-addition process for: " + extensionArtifact ); getLogger().debug( "Starting extension-addition process for: " + extensionArtifact );
if ( extensionArtifact != null ) if ( extensionArtifact != null )
{ {
ArtifactFilter filter = ArtifactFilter filter =
new ProjectArtifactExceptionFilter( artifactFilterManager.getArtifactFilter(), projectArtifact ); new ProjectArtifactExceptionFilter( artifactFilterManager.getArtifactFilter(), projectArtifact );
// TODO: Make this work with managed dependencies, or an analogous management section in the POM.
ArtifactResolutionResult result = ArtifactResolutionResult result =
artifactResolver.resolveTransitively( Collections.singleton( extensionArtifact ), projectArtifact, artifactResolver.resolveTransitively( Collections.singleton( extensionArtifact ), projectArtifact,
Collections.EMPTY_MAP, localRepository, remoteRepositories, Collections.EMPTY_MAP, localRepository, remoteRepositories,
@ -147,7 +148,7 @@ public class DefaultExtensionManager
getLogger().debug( "Adding to extension classpath: " + a.getFile() + " in classRealm: " + container.getContainerRealm().getId() ); getLogger().debug( "Adding to extension classpath: " + a.getFile() + " in classRealm: " + container.getContainerRealm().getId() );
container.addJarResource( a.getFile() ); container.addJarResource( a.getFile() );
artifactFilterManager.excludeArtifact( a.getArtifactId() ); artifactFilterManager.excludeArtifact( a.getArtifactId() );
} }
} }
@ -161,7 +162,7 @@ public class DefaultExtensionManager
public void contextualize( Context context ) public void contextualize( Context context )
throws ContextException throws ContextException
{ {
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY ); container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
} }
private static final class ActiveArtifactResolver private static final class ActiveArtifactResolver
@ -190,7 +191,7 @@ public class DefaultExtensionManager
Artifact projectArtifact ) Artifact projectArtifact )
{ {
this.passThroughFilter = passThroughFilter; this.passThroughFilter = passThroughFilter;
this.projectDependencyConflictId = projectArtifact.getDependencyConflictId(); projectDependencyConflictId = projectArtifact.getDependencyConflictId();
} }
public boolean include( Artifact artifact ) public boolean include( Artifact artifact )