PR: MNG-140

split artifact impl from api so that dep resolution can be used independently of wagon
only the first step in making maven-artifact more useful as a public api - more changes to be made


git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@191634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-06-21 06:49:49 +00:00
parent d6b4a7adea
commit 26d36d8959
94 changed files with 845 additions and 627 deletions

View File

@ -10,7 +10,7 @@ rm -rf target
echo Run with m2...
time -p m2 jar:jar > /dev/null
time -p m2 -B package > /dev/null
rm -rf target

View File

@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-archetype-core</artifactId>
<packaging>jar</packaging>
<version>1.0-alpha-1</version>
<version>1.0-alpha-2-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>plexus</groupId>
@ -22,7 +22,13 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-alpha-2</version>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>

View File

@ -16,6 +16,7 @@
* limitations under the License.
*/
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.codehaus.plexus.PlexusTestCase;
@ -60,12 +61,12 @@ public void testArchetype()
"legacy" );
String mavenRepoLocal = getTestFile( "target/local-repository" ).toURL().toString();
ArtifactRepository localRepository = new ArtifactRepository( "local", mavenRepoLocal, layout );
ArtifactRepository localRepository = new DefaultArtifactRepository( "local", mavenRepoLocal, layout );
List remoteRepositories = new ArrayList();
String mavenRepoRemote = getTestFile( "src/test/repository" ).toURL().toString();
ArtifactRepository remoteRepository = new ArtifactRepository( "remote", mavenRepoRemote, layout );
ArtifactRepository remoteRepository = new DefaultArtifactRepository( "remote", mavenRepoRemote, layout );
remoteRepositories.add( remoteRepository );

View File

@ -7,6 +7,7 @@
</parent>
<artifactId>maven-archiver</artifactId>
<name>Maven Archiver</name>
<version>2.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>plexus</groupId>

View File

@ -14,16 +14,19 @@
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<artifactId>maven-artifact-manager</artifactId>
<version>2.0-SNAPSHOT</version>
<!--
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
-->
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -17,8 +17,9 @@
*/
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
@ -75,7 +76,7 @@ protected ArtifactRepository createLocalArtifactRepository()
CustomWagonManager manager = (CustomWagonManager) lookup( WagonManager.ROLE );
manager.setLocalRepository( localRepository.getLocation() );
return new ArtifactRepository( "local", "file://" + localRepository.getLocation(), repositoryLayout );
return new DefaultArtifactRepository( "local", "file://" + localRepository.getLocation(), repositoryLayout );
}
protected ArtifactRepository createRemoteArtifactRepository( RemoteRepository repository )

View File

@ -0,0 +1,35 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<artifactId>maven-artifact-manager</artifactId>
<version>2.0-SNAPSHOT</version>
<name>MAven Artifact Manager</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>1.0-alpha-4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>1.0-alpha-4</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,4 +1,4 @@
package org.apache.maven.artifact;
package org.apache.maven.artifact.manager;
/*
* Copyright 2001-2005 The Apache Software Foundation.

View File

@ -17,9 +17,9 @@
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ChecksumFailedException;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.wagon.ConnectionException;
import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.TransferFailedException;
@ -78,8 +78,8 @@ public Wagon getWagon( String protocol )
}
catch ( ComponentLookupException e )
{
throw new UnsupportedProtocolException( "Cannot find wagon which supports the requested protocol: "
+ protocol, e );
throw new UnsupportedProtocolException(
"Cannot find wagon which supports the requested protocol: " + protocol, e );
}
return wagon;
@ -99,7 +99,7 @@ public void putArtifactMetadata( File source, ArtifactMetadata artifactMetadata,
}
private void putRemoteFile( ArtifactRepository repository, File source, String remotePath,
TransferListener downloadMonitor )
TransferListener downloadMonitor )
throws TransferFailedException
{
String protocol = repository.getProtocol();
@ -139,7 +139,8 @@ private void putRemoteFile( ArtifactRepository repository, File source, String r
try
{
wagon.connect( repository, getAuthenticationInfo( repository.getId() ), getProxy( protocol ) );
wagon.connect( new Repository( repository.getId(), repository.getUrl() ),
getAuthenticationInfo( repository.getId() ), getProxy( protocol ) );
wagon.put( source, remotePath );
@ -242,17 +243,17 @@ public void getArtifactMetadata( ArtifactMetadata metadata, ArtifactRepository r
}
private void getRemoteFile( ArtifactRepository repository, File destination, String remotePath,
TransferListener downloadMonitor )
TransferListener downloadMonitor )
throws TransferFailedException, ResourceDoesNotExistException, ChecksumFailedException
{
// TODO: better excetpions - transfer failed is not enough?
Wagon wagon;
Repository mirror = getMirror( repository.getId() );
ArtifactRepository mirror = getMirror( repository.getId() );
if ( mirror != null )
{
repository = repository.createMirror( mirror );
repository = mirror;
}
String protocol = repository.getProtocol();
@ -291,22 +292,23 @@ private void getRemoteFile( ArtifactRepository repository, File destination, Str
try
{
wagon.connect( repository, getAuthenticationInfo( repository.getId() ), getProxy( protocol ) );
wagon.connect( new Repository( repository.getId(), repository.getUrl() ),
getAuthenticationInfo( repository.getId() ), getProxy( protocol ) );
boolean firstRun = true;
boolean retry = false;
// this will run at most twice. The first time, the firstRun flag is turned off, and if the retry flag
// is set on the first run, it will be turned off and not re-set on the second try. This is because the
// only way the retry flag can be set is if ( firstRun == true ).
while( firstRun || retry )
while ( firstRun || retry )
{
// reset the retry flag.
retry = false;
// This should take care of creating destination directory now on
wagon.get( remotePath, temp );
// keep the checksum files from showing up on the download monitor...
if ( downloadMonitor != null )
{
@ -327,13 +329,14 @@ private void getRemoteFile( ArtifactRepository repository, File destination, Str
if ( sha1TryException instanceof ChecksumFailedException )
{
// if this is the second try, handle the problem...otherwise, let it try again.
if( firstRun )
if ( firstRun )
{
retry = true;
}
else
{
handleChecksumFailure( repository, sha1TryException.getMessage(), sha1TryException.getCause() );
handleChecksumFailure( repository, sha1TryException.getMessage(),
sha1TryException.getCause() );
}
}
// if this IS NOT a ChecksumFailedException, it was a problem with transfer/read of the checksum
@ -348,22 +351,24 @@ private void getRemoteFile( ArtifactRepository repository, File destination, Str
{
// if we also fail to verify based on the MD5 checksum, and the checksum transfer/read
// succeeded, then we need to determine whether to retry or handle it as a failure.
if( md5TryException instanceof ChecksumFailedException )
if ( md5TryException instanceof ChecksumFailedException )
{
// only retry once.
if( firstRun )
if ( firstRun )
{
retry = true;
}
else
{
handleChecksumFailure( repository, md5TryException.getMessage(), md5TryException.getCause() );
handleChecksumFailure( repository, md5TryException.getMessage(),
md5TryException.getCause() );
}
}
// otherwise, this was a failed transfer, and we don't want to retry.
else
{
handleChecksumFailure( repository, "Error retrieving checksum file for " + destination, md5TryException );
handleChecksumFailure( repository, "Error retrieving checksum file for " + destination,
md5TryException );
}
}
}
@ -375,7 +380,7 @@ private void getRemoteFile( ArtifactRepository repository, File destination, Str
{
wagon.addTransferListener( downloadMonitor );
}
// unset the firstRun flag, so we don't get caught in an infinite loop...
firstRun = false;
}
@ -429,7 +434,7 @@ private void getRemoteFile( ArtifactRepository repository, File destination, Str
private void handleChecksumFailure( ArtifactRepository repository, String message, Throwable cause )
throws ChecksumFailedException
{
if( ArtifactRepository.CHECKSUM_POLICY_FAIL.equals( repository.getChecksumPolicy() ) )
if ( ArtifactRepository.CHECKSUM_POLICY_FAIL.equals( repository.getChecksumPolicy() ) )
{
throw new ChecksumFailedException( message, cause );
}
@ -440,7 +445,7 @@ private void handleChecksumFailure( ArtifactRepository repository, String messag
}
private void verifyChecksum( ChecksumObserver checksumObserver, File destination, String remotePath,
String checksumFileExtension, Wagon wagon )
String checksumFileExtension, Wagon wagon )
throws WagonException
{
try
@ -448,8 +453,8 @@ private void verifyChecksum( ChecksumObserver checksumObserver, File destination
// grab it first, because it's about to change...
String actualChecksum = checksumObserver.getActualChecksum();
File checksumFile = new File( destination + ".sha1" );
wagon.get( remotePath + ".sha1", checksumFile );
File checksumFile = new File( destination + checksumFileExtension );
wagon.get( remotePath + checksumFileExtension, checksumFile );
String expectedChecksum = FileUtils.fileRead( checksumFile );
if ( !expectedChecksum.equals( actualChecksum ) )
@ -457,13 +462,14 @@ private void verifyChecksum( ChecksumObserver checksumObserver, File destination
// getLogger().warn(
// "*** CHECKSUM MISMATCH - currently disabled fail due to bad repository checksums ***" );
throw new ChecksumFailedException( "Checksum failed on download: local = '" + actualChecksum
+ "'; remote = '" + expectedChecksum + "'" );
throw new ChecksumFailedException(
"Checksum failed on download: local = '" + actualChecksum + "'; remote = '" + expectedChecksum +
"'" );
}
}
catch ( IOException e )
{
throw new TransferFailedException( "Invalid SHA-1 checksum file", e );
throw new TransferFailedException( "Invalid checksum file", e );
}
}
@ -501,9 +507,9 @@ public AuthenticationInfo getAuthenticationInfo( String id )
return (AuthenticationInfo) authenticationInfoMap.get( id );
}
public Repository getMirror( String mirrorOf )
public ArtifactRepository getMirror( String mirrorOf )
{
return (Repository) mirrors.get( mirrorOf );
return (ArtifactRepository) mirrors.get( mirrorOf );
}
/**
@ -518,7 +524,8 @@ public Repository getMirror( String mirrorOf )
* property format: <code>*.foo.com|localhost</code>.
* @todo [BP] would be nice to configure this via plexus in some way
*/
public void addProxy( String protocol, String host, int port, String username, String password, String nonProxyHosts )
public void addProxy( String protocol, String host, int port, String username, String password,
String nonProxyHosts )
{
ProxyInfo proxyInfo = new ProxyInfo();
proxyInfo.setHost( host );
@ -546,7 +553,7 @@ public void setDownloadMonitor( TransferListener downloadMonitor )
}
public void addAuthenticationInfo( String repositoryId, String username, String password, String privateKey,
String passphrase )
String passphrase )
{
AuthenticationInfo authInfo = new AuthenticationInfo();
@ -563,7 +570,7 @@ public void addAuthenticationInfo( String repositoryId, String username, String
public void addMirror( String id, String mirrorOf, String url )
{
Repository mirror = new Repository( id, url );
ArtifactRepository mirror = new DefaultArtifactRepository( id, url, null );
mirrors.put( mirrorOf, mirror );
}

View File

@ -19,13 +19,14 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.TransferFailedException;
import org.apache.maven.wagon.UnsupportedProtocolException;
import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.authentication.AuthenticationInfo;
import org.apache.maven.wagon.proxy.ProxyInfo;
import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.proxy.ProxyInfo;
import java.io.File;
import java.util.List;

View File

@ -16,8 +16,8 @@
* limitations under the License.
*/
import org.codehaus.plexus.util.StringUtils;
import org.apache.maven.artifact.Artifact;
import org.codehaus.plexus.util.StringUtils;
import java.io.File;
import java.text.DateFormat;

View File

@ -0,0 +1,82 @@
package org.apache.maven.artifact.repository;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.wagon.repository.Repository;
/**
* This class is an abstraction of the location from/to resources can be
* transfered.
*
* @author <a href="michal.maczka@dimatics.com">Michal Maczka </a>
* @version $Id$
*/
public class DefaultArtifactRepository
extends Repository
implements ArtifactRepository
{
private final String snapshotPolicy;
private final String checksumPolicy;
private final ArtifactRepositoryLayout layout;
public DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout )
{
this( id, url, layout, SNAPSHOT_POLICY_NEVER, CHECKSUM_POLICY_WARN );
}
public DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, String snapshotPolicy, String checksumPolicy )
{
super( id, url );
this.layout = layout;
this.snapshotPolicy = snapshotPolicy;
this.checksumPolicy = checksumPolicy;
}
public String pathOf( Artifact artifact )
{
return layout.pathOf( artifact );
}
public String pathOfMetadata( ArtifactMetadata artifactMetadata )
{
return layout.pathOfMetadata( artifactMetadata );
}
public String getSnapshotPolicy()
{
return snapshotPolicy;
}
public String getChecksumPolicy()
{
return checksumPolicy;
}
public boolean failOnChecksumMismatch()
{
return CHECKSUM_POLICY_FAIL.equals( checksumPolicy );
}
}

View File

@ -17,13 +17,11 @@
*/
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.codehaus.plexus.logging.AbstractLogEnabled;
/**
* @author jdcasey
*/
public class DefaultArtifactRepositoryFactory
extends AbstractLogEnabled
implements ArtifactRepositoryFactory
{
// TODO: use settings?
@ -61,7 +59,7 @@ public ArtifactRepository createArtifactRepository( String id, String url,
csumPolicy = ArtifactRepository.CHECKSUM_POLICY_FAIL;
}
repo = new ArtifactRepository( id, url, repositoryLayout, snapPolicy, csumPolicy );
repo = new DefaultArtifactRepository( id, url, repositoryLayout, snapPolicy, csumPolicy );
return repo;
}

View File

@ -32,16 +32,10 @@
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @todo create an AbstractArtifactResolver that does the transitive boilerplate
*/
public class DefaultArtifactResolver
extends AbstractLogEnabled
implements ArtifactResolver
@ -56,6 +50,8 @@ public class DefaultArtifactResolver
protected ArtifactFactory artifactFactory;
private ArtifactCollector artifactCollector;
// ----------------------------------------------------------------------
// Implementation
// ----------------------------------------------------------------------
@ -75,8 +71,9 @@ public void resolve( Artifact artifact, List remoteRepositories, ArtifactReposit
// ----------------------------------------------------------------------
Logger logger = getLogger();
logger.debug( "Resolving: " + artifact.getId() + " from:\n" + "{localRepository: " + localRepository + "}\n" +
"{remoteRepositories: " + remoteRepositories + "}" );
logger.debug(
"Resolving: " + artifact.getId() + " from:\n" + "{localRepository: " + localRepository + "}\n" +
"{remoteRepositories: " + remoteRepositories + "}" );
String localPath = localRepository.pathOf( artifact );
@ -144,7 +141,8 @@ public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteR
{
ArtifactResolutionResult artifactResolutionResult;
artifactResolutionResult = collect( artifacts, localRepository, remoteRepositories, source, filter );
artifactResolutionResult = artifactCollector.collect( artifacts, localRepository, remoteRepositories, source,
filter, artifactFactory );
for ( Iterator i = artifactResolutionResult.getArtifacts().values().iterator(); i.hasNext(); )
{
@ -170,138 +168,4 @@ public ArtifactResolutionResult resolveTransitively( Artifact artifact, List rem
{
return resolveTransitively( Collections.singleton( artifact ), remoteRepositories, localRepository, source );
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
private ArtifactResolutionResult collect( Set artifacts, ArtifactRepository localRepository,
List remoteRepositories, ArtifactMetadataSource source,
ArtifactFilter filter )
throws ArtifactResolutionException
{
ArtifactResolutionResult result = new ArtifactResolutionResult();
Map resolvedArtifacts = new HashMap();
List queue = new LinkedList();
queue.add( artifacts );
while ( !queue.isEmpty() )
{
Set currentArtifacts = (Set) queue.remove( 0 );
for ( Iterator i = currentArtifacts.iterator(); i.hasNext(); )
{
Artifact newArtifact = (Artifact) i.next();
String id = newArtifact.getDependencyConflictId();
if ( resolvedArtifacts.containsKey( id ) )
{
Artifact knownArtifact = (Artifact) resolvedArtifacts.get( id );
String newVersion = newArtifact.getVersion();
String knownVersion = knownArtifact.getVersion();
if ( !newVersion.equals( knownVersion ) )
{
addConflict( result, knownArtifact, newArtifact );
}
// TODO: scope handler
boolean updateScope = false;
if ( Artifact.SCOPE_RUNTIME.equals( newArtifact.getScope() ) &&
Artifact.SCOPE_TEST.equals( knownArtifact.getScope() ) )
{
updateScope = true;
}
if ( Artifact.SCOPE_COMPILE.equals( newArtifact.getScope() ) &&
!Artifact.SCOPE_COMPILE.equals( knownArtifact.getScope() ) )
{
updateScope = true;
}
if ( updateScope )
{
// TODO: Artifact factory?
// TODO: [jc] Is this a better way to centralize artifact construction here?
Artifact artifact = artifactFactory.createArtifact( knownArtifact.getGroupId(),
knownArtifact.getArtifactId(),
knownVersion, newArtifact.getScope(),
knownArtifact.getType() );
resolvedArtifacts.put( artifact.getDependencyConflictId(), artifact );
}
}
else
{
// ----------------------------------------------------------------------
// It's the first time we have encountered this artifact
// ----------------------------------------------------------------------
if ( filter != null && !filter.include( newArtifact ) )
{
continue;
}
resolvedArtifacts.put( id, newArtifact );
Set referencedDependencies = null;
try
{
referencedDependencies = source.retrieve( newArtifact, localRepository, remoteRepositories );
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new TransitiveArtifactResolutionException( e.getMessage(), newArtifact,
remoteRepositories, e );
}
// the pom for given dependency exisit we will add it to the
// queue
queue.add( referencedDependencies );
}
}
}
// ----------------------------------------------------------------------
// the dependencies list is keyed by groupId+artifactId+type
// so it must be 'rekeyed' to the complete id:
// groupId+artifactId+type+version
// ----------------------------------------------------------------------
Map artifactResult = result.getArtifacts();
for ( Iterator it = resolvedArtifacts.values().iterator(); it.hasNext(); )
{
Artifact artifact = (Artifact) it.next();
artifactResult.put( artifact.getId(), artifact );
}
return result;
}
private void addConflict( ArtifactResolutionResult result, Artifact knownArtifact, Artifact newArtifact )
{
List conflicts;
conflicts = (List) result.getConflicts().get( newArtifact.getDependencyConflictId() );
if ( conflicts == null )
{
conflicts = new LinkedList();
conflicts.add( knownArtifact );
result.getConflicts().put( newArtifact.getDependencyConflictId(), conflicts );
}
conflicts.add( newArtifact );
}
}

View File

@ -0,0 +1,104 @@
<component-set>
<components>
<!--
|
| WagonManager
|
-->
<component>
<role>org.apache.maven.artifact.manager.WagonManager</role>
<implementation>org.apache.maven.artifact.manager.DefaultWagonManager</implementation>
</component>
<!--
|
| Transformations
|
-->
<component>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<role-hint>snapshot</role-hint>
<implementation>org.apache.maven.artifact.transform.SnapshotTransformation</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<role-hint>release</role-hint>
<implementation>org.apache.maven.artifact.transform.ReleaseArtifactTransformation</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
</requirements>
</component>
<!--
|
| Resolver
|
-->
<component>
<role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
<implementation>org.apache.maven.artifact.resolver.DefaultArtifactResolver</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<field-name>artifactTransformations</field-name>
</requirement>
<requirement>
<role>org.apache.maven.artifact.factory.ArtifactFactory</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.resolver.ArtifactCollector</role>
</requirement>
</requirements>
</component>
<!--
|
| ArtifactInstaller
|
-->
<component>
<role>org.apache.maven.artifact.installer.ArtifactInstaller</role>
<implementation>org.apache.maven.artifact.installer.DefaultArtifactInstaller</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<field-name>artifactTransformations</field-name>
</requirement>
</requirements>
</component>
<!--
|
| ArtifactDeployer
|
-->
<component>
<role>org.apache.maven.artifact.deployer.ArtifactDeployer</role>
<implementation>org.apache.maven.artifact.deployer.DefaultArtifactDeployer</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<field-name>artifactTransformations</field-name>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
<implementation>org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory</implementation>
</component>
</components>
</component-set>

View File

@ -16,9 +16,10 @@
package org.apache.maven.artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.codehaus.plexus.PlexusTestCase;
import java.io.File;
@ -55,7 +56,8 @@ protected ArtifactRepository badLocalRepository()
ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
"legacy" );
ArtifactRepository localRepository = new ArtifactRepository( "test", "file://" + f.getPath(), repoLayout );
ArtifactRepository localRepository = new DefaultArtifactRepository( "test", "file://" + f.getPath(),
repoLayout );
return localRepository;
}
@ -75,7 +77,8 @@ protected ArtifactRepository localRepository()
ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
"legacy" );
ArtifactRepository localRepository = new ArtifactRepository( "local", "file://" + f.getPath(), repoLayout );
ArtifactRepository localRepository = new DefaultArtifactRepository( "local", "file://" + f.getPath(),
repoLayout );
return localRepository;
}
@ -90,7 +93,9 @@ protected ArtifactRepository remoteRepository()
ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
"legacy" );
ArtifactRepository repository = new ArtifactRepository( "test", "file://" + f.getPath(), repoLayout, ArtifactRepository.SNAPSHOT_POLICY_NEVER, ArtifactRepository.CHECKSUM_POLICY_WARN );
ArtifactRepository repository = new DefaultArtifactRepository( "test", "file://" + f.getPath(), repoLayout,
ArtifactRepository.SNAPSHOT_POLICY_NEVER,
ArtifactRepository.CHECKSUM_POLICY_WARN );
return repository;
}
@ -101,7 +106,8 @@ protected ArtifactRepository badRemoteRepository()
ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
"legacy" );
ArtifactRepository repository = new ArtifactRepository( "test", "http://foo.bar/repository", repoLayout );
ArtifactRepository repository = new DefaultArtifactRepository( "test", "http://foo.bar/repository",
repoLayout );
return repository;
}
@ -243,13 +249,15 @@ protected Artifact createArtifact( String artifactId, String version )
protected Artifact createArtifact( String artifactId, String version, String type )
{
// TODO: fix handler instantiation
return new DefaultArtifact( "org.apache.maven", artifactId, version, null, type, null, new DefaultArtifactHandler( type ) );
return new DefaultArtifact( "org.apache.maven", artifactId, version, null, type, null,
new DefaultArtifactHandler( type ) );
}
protected Artifact createArtifact( String groupId, String artifactId, String version, String type )
{
// TODO: fix handler instantiation
return new DefaultArtifact( groupId, artifactId, version, Artifact.SCOPE_COMPILE, type, null, new DefaultArtifactHandler( type ) );
return new DefaultArtifact( groupId, artifactId, version, Artifact.SCOPE_COMPILE, type, null,
new DefaultArtifactHandler( type ) );
}
protected void deleteLocalArtifact( Artifact artifact )

View File

@ -18,6 +18,11 @@
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>

View File

@ -17,8 +17,9 @@
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
import org.codehaus.plexus.PlexusTestCase;
@ -62,7 +63,7 @@ protected void setUp()
ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) container.lookup(
ArtifactRepositoryLayout.ROLE, "default" );
localRepository = new ArtifactRepository( "local", "file://" + localRepo, repositoryLayout );
localRepository = new DefaultArtifactRepository( "local", "file://" + localRepo, repositoryLayout );
}
}

View File

@ -10,19 +10,8 @@
<dependencies>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
<version>1.0-alpha-4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<version>1.0-alpha-4</version>
<scope>test</scope>
<artifactId>plexus-utils</artifactId>
<version>1.0-alpha-3</version>
</dependency>
</dependencies>
</project>

View File

@ -16,11 +16,10 @@
* limitations under the License.
*/
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.handler.ArtifactHandler;
import java.io.File;
import java.util.List;

View File

@ -16,10 +16,10 @@
* limitations under the License.
*/
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.codehaus.plexus.util.StringUtils;
import java.io.File;

View File

@ -17,8 +17,8 @@
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import java.util.List;
import java.util.Set;

View File

@ -18,84 +18,44 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.wagon.repository.Repository;
/**
* This class is an abstraction of the location from/to resources can be
* transfered.
* TODO: describe
*
* @author <a href="michal.maczka@dimatics.com">Michal Maczka </a>
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @version $Id$
*/
public class ArtifactRepository
extends Repository
public interface ArtifactRepository
{
private final String snapshotPolicy;
private final String checksumPolicy;
String SNAPSHOT_POLICY_NEVER = "never";
private final ArtifactRepositoryLayout layout;
String SNAPSHOT_POLICY_ALWAYS = "always";
public static final String SNAPSHOT_POLICY_NEVER = "never";
String SNAPSHOT_POLICY_DAILY = "daily";
public static final String SNAPSHOT_POLICY_ALWAYS = "always";
String SNAPSHOT_POLICY_INTERVAL = "interval";
public static final String SNAPSHOT_POLICY_DAILY = "daily";
String CHECKSUM_POLICY_FAIL = "fail";
public static final String SNAPSHOT_POLICY_INTERVAL = "interval";
public static final String CHECKSUM_POLICY_FAIL = "fail";
public static final String CHECKSUM_POLICY_WARN = "warn";
public static final String CHECKSUM_ALGORITHM_SHA1 = "SHA-1";
public static final String CHECKSUM_ALGORITHM_MD5 = "MD5";
String CHECKSUM_POLICY_WARN = "warn";
public ArtifactRepository( String id, String url, ArtifactRepositoryLayout layout )
{
this( id, url, layout, SNAPSHOT_POLICY_NEVER, CHECKSUM_POLICY_WARN );
}
String CHECKSUM_ALGORITHM_SHA1 = "SHA-1";
public ArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, String snapshotPolicy, String checksumPolicy )
{
super( id, url );
String CHECKSUM_ALGORITHM_MD5 = "MD5";
this.layout = layout;
String pathOf( Artifact artifact );
this.snapshotPolicy = snapshotPolicy;
this.checksumPolicy = checksumPolicy;
}
String pathOfMetadata( ArtifactMetadata artifactMetadata );
public String pathOf( Artifact artifact )
{
return layout.pathOf( artifact );
}
String getUrl();
public String pathOfMetadata( ArtifactMetadata artifactMetadata )
{
return layout.pathOfMetadata( artifactMetadata );
}
String getBasedir();
public String getSnapshotPolicy()
{
return snapshotPolicy;
}
public String getChecksumPolicy()
{
return checksumPolicy;
}
public boolean failOnChecksumMismatch()
{
return CHECKSUM_POLICY_FAIL.equals( checksumPolicy );
}
public ArtifactRepository createMirror( Repository mirror )
{
return new ArtifactRepository( mirror.getId(), mirror.getUrl(), layout, snapshotPolicy, checksumPolicy );
}
}
String getSnapshotPolicy();
String getProtocol();
String getId();
String getChecksumPolicy();
}

View File

@ -19,7 +19,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.transform.ReleaseArtifactTransformation;
/**
* @author jdcasey
@ -58,7 +57,7 @@ public String pathOfMetadata( ArtifactMetadata metadata )
path.append( metadata.getGroupId().replace( '.', '/' ) ).append( '/' );
path.append( metadata.getArtifactId() ).append( '/' );
if ( !metadata.getBaseVersion().equals( ReleaseArtifactTransformation.RELEASE_VERSION ) )
if ( !metadata.getBaseVersion().equals( "RELEASE" ) )
{
path.append( metadata.getBaseVersion() ).append( '/' );
}

View File

@ -0,0 +1,37 @@
package org.apache.maven.artifact.resolver;/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import java.util.List;
import java.util.Set;
/**
* TODO: describe
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @version $Id$
*/
public interface ArtifactCollector
{
ArtifactResolutionResult collect( Set artifacts, ArtifactRepository localRepository, List remoteRepositories,
ArtifactMetadataSource source, ArtifactFilter filter,
ArtifactFactory artifactFactory )
throws ArtifactResolutionException;
}

View File

@ -1,11 +1,5 @@
package org.apache.maven.artifact.resolver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import java.util.Iterator;
import java.util.List;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
@ -22,6 +16,12 @@
* limitations under the License.
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import java.util.Iterator;
import java.util.List;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$

View File

@ -0,0 +1,170 @@
package org.apache.maven.artifact.resolver;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* TODO: describe
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @version $Id$
*/
public class DefaultArtifactCollector
implements ArtifactCollector
{
public ArtifactResolutionResult collect( Set artifacts, ArtifactRepository localRepository, List remoteRepositories,
ArtifactMetadataSource source, ArtifactFilter filter,
ArtifactFactory artifactFactory )
throws ArtifactResolutionException
{
ArtifactResolutionResult result = new ArtifactResolutionResult();
Map resolvedArtifacts = new HashMap();
List queue = new LinkedList();
queue.add( artifacts );
while ( !queue.isEmpty() )
{
Set currentArtifacts = (Set) queue.remove( 0 );
for ( Iterator i = currentArtifacts.iterator(); i.hasNext(); )
{
Artifact newArtifact = (Artifact) i.next();
String id = newArtifact.getDependencyConflictId();
if ( resolvedArtifacts.containsKey( id ) )
{
Artifact knownArtifact = (Artifact) resolvedArtifacts.get( id );
String newVersion = newArtifact.getVersion();
String knownVersion = knownArtifact.getVersion();
if ( !newVersion.equals( knownVersion ) )
{
addConflict( result, knownArtifact, newArtifact );
}
// TODO: scope handler
boolean updateScope = false;
if ( Artifact.SCOPE_RUNTIME.equals( newArtifact.getScope() ) &&
Artifact.SCOPE_TEST.equals( knownArtifact.getScope() ) )
{
updateScope = true;
}
if ( Artifact.SCOPE_COMPILE.equals( newArtifact.getScope() ) &&
!Artifact.SCOPE_COMPILE.equals( knownArtifact.getScope() ) )
{
updateScope = true;
}
if ( updateScope )
{
// TODO: Artifact factory?
// TODO: [jc] Is this a better way to centralize artifact construction here?
Artifact artifact = artifactFactory.createArtifact(
knownArtifact.getGroupId(), knownArtifact.getArtifactId(), knownVersion,
newArtifact.getScope(), knownArtifact.getType() );
resolvedArtifacts.put( artifact.getDependencyConflictId(), artifact );
}
}
else
{
// ----------------------------------------------------------------------
// It's the first time we have encountered this artifact
// ----------------------------------------------------------------------
if ( filter != null && !filter.include( newArtifact ) )
{
continue;
}
resolvedArtifacts.put( id, newArtifact );
Set referencedDependencies = null;
try
{
referencedDependencies = source.retrieve( newArtifact, localRepository, remoteRepositories );
}
catch ( ArtifactMetadataRetrievalException e )
{
throw new TransitiveArtifactResolutionException( e.getMessage(), newArtifact,
remoteRepositories, e );
}
// the pom for given dependency exisit we will add it to the
// queue
queue.add( referencedDependencies );
}
}
}
// ----------------------------------------------------------------------
// the dependencies list is keyed by groupId+artifactId+type
// so it must be 'rekeyed' to the complete id:
// groupId+artifactId+type+version
// ----------------------------------------------------------------------
Map artifactResult = result.getArtifacts();
for ( Iterator it = resolvedArtifacts.values().iterator(); it.hasNext(); )
{
Artifact artifact = (Artifact) it.next();
artifactResult.put( artifact.getId(), artifact );
}
return result;
}
private void addConflict( ArtifactResolutionResult result, Artifact knownArtifact, Artifact newArtifact )
{
List conflicts;
conflicts = (List) result.getConflicts().get( newArtifact.getDependencyConflictId() );
if ( conflicts == null )
{
conflicts = new LinkedList();
conflicts.add( knownArtifact );
result.getConflicts().put( newArtifact.getDependencyConflictId(), conflicts );
}
conflicts.add( newArtifact );
}
}

View File

@ -1,98 +1,5 @@
<component-set>
<components>
<!--
|
| WagonManager
|
-->
<component>
<role>org.apache.maven.artifact.manager.WagonManager</role>
<implementation>org.apache.maven.artifact.manager.DefaultWagonManager</implementation>
</component>
<!--
|
| Transformations
|
-->
<component>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<role-hint>snapshot</role-hint>
<implementation>org.apache.maven.artifact.transform.SnapshotTransformation</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<role-hint>release</role-hint>
<implementation>org.apache.maven.artifact.transform.ReleaseArtifactTransformation</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
</requirements>
</component>
<!--
|
| Resolver
|
-->
<component>
<role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
<implementation>org.apache.maven.artifact.resolver.DefaultArtifactResolver</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<field-name>artifactTransformations</field-name>
</requirement>
<requirement>
<role>org.apache.maven.artifact.factory.ArtifactFactory</role>
</requirement>
</requirements>
</component>
<!--
|
| ArtifactInstaller
|
-->
<component>
<role>org.apache.maven.artifact.installer.ArtifactInstaller</role>
<implementation>org.apache.maven.artifact.installer.DefaultArtifactInstaller</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<field-name>artifactTransformations</field-name>
</requirement>
</requirements>
</component>
<!--
|
| ArtifactDeployer
|
-->
<component>
<role>org.apache.maven.artifact.deployer.ArtifactDeployer</role>
<implementation>org.apache.maven.artifact.deployer.DefaultArtifactDeployer</implementation>
<requirements>
<requirement>
<role>org.apache.maven.artifact.manager.WagonManager</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.transform.ArtifactTransformation</role>
<field-name>artifactTransformations</field-name>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
<role-hint>default</role-hint>
@ -215,5 +122,10 @@
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
<implementation>org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory</implementation>
</component>
<component>
<role>org.apache.maven.artifact.resolver.ArtifactCollector</role>
<implementation>org.apache.maven.artifact.resolver.DefaultArtifactCollector</implementation>
</component>
</components>
</component-set>

View File

@ -56,6 +56,12 @@
<artifactId>maven-artifact</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<!-- TODO: make it runtime by removing new DefaultArtifactRepository and WagonManager -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>

View File

@ -46,6 +46,7 @@
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
@ -104,6 +105,10 @@ public MavenExecutionResponse execute( MavenExecutionRequest request )
{
throw new ReactorException( "Unable to configure Maven for execution", e );
}
catch ( ComponentLifecycleException e )
{
throw new ReactorException( "Unable to configure Maven for execution", e );
}
EventDispatcher dispatcher = request.getEventDispatcher();
String event = MavenEvents.REACTOR_EXECUTION;
@ -398,31 +403,38 @@ protected MavenSession createSession( MavenExecutionRequest request, MavenProjec
* the wagons, shouldn't we?
*/
private void resolveParameters( Settings settings )
throws ComponentLookupException
throws ComponentLookupException, ComponentLifecycleException
{
WagonManager wagonManager = (WagonManager) container.lookup( WagonManager.ROLE );
Proxy proxy = settings.getActiveProxy();
if ( proxy != null )
try
{
wagonManager.addProxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(),
proxy.getPassword(), proxy.getNonProxyHosts() );
Proxy proxy = settings.getActiveProxy();
if ( proxy != null )
{
wagonManager.addProxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(),
proxy.getPassword(), proxy.getNonProxyHosts() );
}
for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
{
Server server = (Server) i.next();
wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), server.getPassword(),
server.getPrivateKey(), server.getPassphrase() );
}
for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
{
Mirror mirror = (Mirror) i.next();
wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() );
}
}
for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
finally
{
Server server = (Server) i.next();
wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), server.getPassword(),
server.getPrivateKey(), server.getPassphrase() );
}
for ( Iterator i = settings.getMirrors().iterator(); i.hasNext(); )
{
Mirror mirror = (Mirror) i.next();
wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() );
container.release( wagonManager );
}
}
@ -596,7 +608,7 @@ else if ( secs == 1 )
{
msg += "1 second";
}
else if ( min > 0 )
else if ( min == 0 )
{
msg += "< 1 second";
}

View File

@ -25,8 +25,9 @@
import org.apache.commons.cli.PosixParser;
import org.apache.maven.Maven;
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest;
@ -376,7 +377,7 @@ private static ArtifactRepository createLocalRepository( Embedder embedder, Sett
ArtifactRepositoryFactory.ROLE );
String url = "file://" + settings.getLocalRepository();
ArtifactRepository localRepository = new ArtifactRepository( "local", url, repositoryLayout );
ArtifactRepository localRepository = new DefaultArtifactRepository( "local", url, repositoryLayout );
boolean snapshotPolicySet = false;
if ( commandLine.hasOption( CLIManager.OFFLINE ) )

View File

@ -18,6 +18,7 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.execution.MavenSession;
@ -77,7 +78,7 @@ public void testLocalRepositoryExtraction()
ExpressionEvaluator expressionEvaluator = createExpressionEvaluator( createDefaultProject(), null );
Object value = expressionEvaluator.evaluate( "${localRepository}" );
assertEquals( "local", ( (ArtifactRepository) value ).getId() );
assertEquals( "local", ( (DefaultArtifactRepository) value ).getId() );
}
public void testTwoExpressions()
@ -132,7 +133,7 @@ private ExpressionEvaluator createExpressionEvaluator( MavenProject project, Plu
ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
"legacy" );
ArtifactRepository repo = new ArtifactRepository( "local", "target/repo", repoLayout );
ArtifactRepository repo = new DefaultArtifactRepository( "local", "target/repo", repoLayout );
PlexusContainer container = getContainer();
MavenSession session = createSession( project, container, repo );

View File

@ -1,4 +1,3 @@
import compile.CompilerConfiguration;
import compile.JavacCompiler;
import download.ArtifactDownloader;
@ -35,28 +34,23 @@
public class MBoot
{
String[] builds = new String[]{"maven-model", "maven-monitor", "maven-plugin-api",
"maven-plugin-descriptor", "maven-artifact", "maven-script/maven-script-marmalade",
"maven-script/maven-script-beanshell", "maven-project",
"maven-settings", "maven-profile", "maven-plugin-registry",
"maven-reporting/maven-reporting-api", "maven-core", "maven-archiver",
"maven-plugin-tools/maven-plugin-tools-api",
"maven-plugin-tools/maven-plugin-tools-java",
"maven-plugin-tools/maven-plugin-tools-beanshell",
"maven-plugin-tools/maven-plugin-tools-pluggy",
"maven-plugin-tools/maven-plugin-tools-marmalade", "maven-core-it-verifier"};
String[] builds = new String[]{"maven-model", "maven-monitor", "maven-plugin-api", "maven-plugin-descriptor",
"maven-artifact", "maven-artifact-manager", "maven-artifact-test", "maven-script/maven-script-marmalade",
"maven-script/maven-script-beanshell", "maven-project", "maven-settings", "maven-profile",
"maven-plugin-registry", "maven-reporting/maven-reporting-api", "maven-core", "maven-archiver",
"maven-plugin-tools/maven-plugin-tools-api", "maven-plugin-tools/maven-plugin-tools-java",
"maven-plugin-tools/maven-plugin-tools-beanshell", "maven-plugin-tools/maven-plugin-tools-pluggy",
"maven-plugin-tools/maven-plugin-tools-marmalade", "maven-core-it-verifier"};
String[] pluginBuilds = new String[]{"maven-plugins/maven-clean-plugin", "maven-plugins/maven-compiler-plugin",
"maven-plugins/maven-install-plugin", "maven-plugins/maven-jar-plugin",
"maven-plugins/maven-plugin-plugin", "maven-plugins/maven-resources-plugin",
"maven-plugins/maven-surefire-plugin"};
"maven-plugins/maven-install-plugin", "maven-plugins/maven-jar-plugin", "maven-plugins/maven-plugin-plugin",
"maven-plugins/maven-resources-plugin", "maven-plugins/maven-surefire-plugin"};
private static final Map MODELLO_TARGET_VERSIONS;
private static final Map MODELLO_MODEL_FILES;
static
{
static {
Map targetVersions = new TreeMap();
targetVersions.put( "maven-model", "4.0.0" );
targetVersions.put( "maven-settings", "1.0.0" );
@ -182,8 +176,9 @@ public void run( String[] args )
System.out.println();
System.out.println( "HOWEVER, since you did not specify a repository path, maven will use: " +
repoDir.getAbsolutePath() + " to store artifacts locally." );
System.out.println(
"HOWEVER, since you did not specify a repository path, maven will use: " + repoDir.getAbsolutePath() +
" to store artifacts locally." );
}
File repoLocalFile = new File( mavenRepoLocal );
@ -220,11 +215,13 @@ public void run( String[] args )
{
if ( !new File( dist, "bin/m2.conf" ).exists() )
{
System.err.println( "The directory given to install Maven in already exists, but does not contain a Maven installation" );
System.err.println(
"The directory given to install Maven in already exists, but does not contain a Maven installation" );
System.err.println();
System.err.println( "\t" + dist );
System.err.println();
System.err.println( "If you really mean to install Maven to this location, please delete the directory first" );
System.err.println(
"If you really mean to install Maven to this location, please delete the directory first" );
System.exit( 1 );
}
}
@ -435,8 +432,8 @@ public void run( String[] args )
{
FileUtils.copyFileToDirectory( source, boot );
}
else if ( d.getArtifactId().equals( "plexus-container-default" )
|| d.getArtifactId().equals( "plexus-utils" ) )
else if ( d.getArtifactId().equals( "plexus-container-default" ) ||
d.getArtifactId().equals( "plexus-utils" ) )
{
FileUtils.copyFileToDirectory( source, core );
}
@ -589,7 +586,8 @@ private ModelReader buildProject( String basedir, String projectId, ClassLoader
}
else
{
compile( reader.getDependencies(), sources, classes, null, null, Dependency.SCOPE_COMPILE, localRepository );
compile( reader.getDependencies(), sources, classes, null, null, Dependency.SCOPE_COMPILE,
localRepository );
}
// ----------------------------------------------------------------------
@ -663,8 +661,8 @@ private void generatePluginDescriptor( String sourceDirectory, String outputDire
m.invoke( null, new Object[]{args} );
}
private void generateSources( String model, String mode, String dir, String modelVersion,
String packageWithVersion, ClassLoader modelloClassLoader )
private void generateSources( String model, String mode, String dir, String modelVersion, String packageWithVersion,
ClassLoader modelloClassLoader )
throws Exception
{
Class c = modelloClassLoader.loadClass( "org.codehaus.modello.ModelloCli" );
@ -856,7 +854,8 @@ private List classpath( Collection dependencies, String extraClasspath, String s
}
else if ( Dependency.SCOPE_RUNTIME.equals( scope ) )
{
if ( d.getScope().equals( Dependency.SCOPE_COMPILE ) || d.getScope().equals( Dependency.SCOPE_RUNTIME ) )
if ( d.getScope().equals( Dependency.SCOPE_COMPILE ) ||
d.getScope().equals( Dependency.SCOPE_RUNTIME ) )
{
classpath.add( element );
}
@ -986,9 +985,9 @@ class SettingsReader
private Proxy activeProxy = null;
private Mirror currentMirror;
private String localRepository;
public String getLocalRepository()
{
return localRepository;
@ -1016,8 +1015,8 @@ public void endElement( String uri, String localName, String rawName )
}
else
{
throw new SAXException( "Invalid profile entry. Missing one or more " +
"fields: {localRepository}." );
throw new SAXException(
"Invalid profile entry. Missing one or more " + "fields: {localRepository}." );
}
}
else if ( "proxy".equals( rawName ) )

View File

@ -132,12 +132,7 @@ public String getPluginLookupKey()
public String getId()
{
String id = constructPluginKey( groupId, artifactId, version );
if ( groupId == null || artifactId == null || version == null )
{
throw new IllegalStateException( "Plugin descriptor ID incomplete: " + id + " in " + getSource() );
}
return id;
return constructPluginKey( groupId, artifactId, version );
}
/**

View File

@ -15,6 +15,12 @@
<artifactId>maven-project</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-test</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-utils</artifactId>

View File

@ -1,43 +1,37 @@
package org.apache.maven.plugin.eclipse;
/*
* Copyright (c) 2004, Codehaus.org
* Copyright 2001-2005 The Apache Software Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* http://www.apache.org/licenses/LICENSE-2.0
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.StringUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@ -75,7 +69,8 @@ private void testProject( String projectName )
ArtifactRepositoryLayout localRepositoryLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "legacy" );
ArtifactRepository localRepository = new ArtifactRepository("local", "file://" + repo.getAbsolutePath(), localRepositoryLayout);
ArtifactRepository localRepository = new DefaultArtifactRepository( "local", "file://" + repo.getAbsolutePath(),
localRepositoryLayout );
MavenProject project = builder.build( new File( basedir, "project.xml" ), localRepository, Collections.EMPTY_LIST );

View File

@ -13,7 +13,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.0-alpha-2</version>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -13,7 +13,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.0-alpha-2</version>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -33,5 +33,11 @@
<artifactId>plexus-utils</artifactId>
<version>1.0-alpha-3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-test</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -22,7 +22,6 @@
public class AlwaysOnProfileActivator
implements ProfileActivator
{
public boolean canDetermineActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation() instanceof AlwaysOnActivation;

View File

@ -21,12 +21,11 @@
public abstract class DetectedProfileActivator
implements ProfileActivator
{
public boolean canDetermineActivation( Profile profile )
{
return !ProfileActivationUtils.profilesWereExplicitlyGiven() && canDetectActivation( profile );
}
protected abstract boolean canDetectActivation( Profile profile );
}

View File

@ -21,7 +21,6 @@
public class ExplicitListingProfileActivator
implements ProfileActivator
{
public boolean canDetermineActivation( Profile profile )
{
return ProfileActivationUtils.profilesWereExplicitlyGiven();

View File

@ -23,7 +23,6 @@
public class JdkPrefixProfileActivator
extends DetectedProfileActivator
{
private static final String JDK_VERSION = System.getProperty( "java.version" );
public boolean isActive( Profile profile )

View File

@ -36,7 +36,6 @@ public class ProfileActivationCalculator
extends AbstractLogEnabled
implements Contextualizable
{
public static final String ROLE = ProfileActivationCalculator.class.getName();
private PlexusContainer container;
@ -59,7 +58,8 @@ public List calculateActiveProfiles( List profiles )
Activation activation = profile.getActivation();
activatorLoop: for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
activatorLoop:
for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
{
ProfileActivator activator = (ProfileActivator) activatorIterator.next();

View File

@ -24,44 +24,43 @@
public final class ProfileActivationUtils
{
public static final String ACTIVE_PROFILE_IDS = "org.apache.maven.ActiveProfiles";
private static List profileList;
private ProfileActivationUtils()
{
}
public static boolean profilesWereExplicitlyGiven()
{
return StringUtils.isNotEmpty( System.getProperty( ACTIVE_PROFILE_IDS ) );
}
public static List getExplicitProfileList()
{
if(!profilesWereExplicitlyGiven())
if ( !profilesWereExplicitlyGiven() )
{
return null;
}
if( profileList == null )
if ( profileList == null )
{
profileList = new ArrayList();
StringTokenizer profileTokens = new StringTokenizer( System.getProperty( ACTIVE_PROFILE_IDS ), "," );
while( profileTokens.hasMoreTokens() )
while ( profileTokens.hasMoreTokens() )
{
String token = profileTokens.nextToken().trim();
if( StringUtils.isNotEmpty( token ) )
if ( StringUtils.isNotEmpty( token ) )
{
profileList.add( token );
}
}
}
return profileList;
}

View File

@ -20,7 +20,6 @@
public interface ProfileActivator
{
static final String ROLE = ProfileActivator.class.getName();
boolean canDetermineActivation( Profile profile );

View File

@ -24,7 +24,6 @@
public class SystemPropertyProfileActivator
extends DetectedProfileActivator
{
protected boolean canDetectActivation( Profile profile )
{
return profile.getActivation() != null && profile.getActivation().getProperty() != null;

View File

@ -24,7 +24,6 @@
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.transform.ReleaseArtifactTransformation;
import org.apache.maven.model.Build;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.Model;
@ -99,7 +98,7 @@ public class DefaultMavenProjectBuilder
private ModelInterpolator modelInterpolator;
private ArtifactRepositoryFactory artifactRepositoryFactory;
private ProfileActivationCalculator profileActivationCalculator;
private final Map modelCache = new HashMap();
@ -148,7 +147,8 @@ public MavenProject build( File projectDescriptor, ArtifactRepository localRepos
return buildFromSourceFile( projectDescriptor, localRepository, externalProfiles );
}
private MavenProject buildFromSourceFile( File projectDescriptor, ArtifactRepository localRepository, List externalProfiles )
private MavenProject buildFromSourceFile( File projectDescriptor, ArtifactRepository localRepository,
List externalProfiles )
throws ProjectBuildingException, ArtifactResolutionException
{
Model model = readModel( projectDescriptor );
@ -216,24 +216,29 @@ private Model findModelFromRepository( Artifact artifact, List remoteArtifactRep
return model;
}
private MavenProject build( String pomLocation, Model model, ArtifactRepository localRepository, List externalProfiles )
private MavenProject build( String pomLocation, Model model, ArtifactRepository localRepository,
List externalProfiles )
throws ProjectBuildingException, ArtifactResolutionException
{
Model superModel = getSuperModel();
LinkedList lineage = new LinkedList();
List aggregatedRemoteWagonRepositories = ProjectUtils.buildArtifactRepositories( superModel.getRepositories(), artifactRepositoryFactory, container );
List aggregatedRemoteWagonRepositories = ProjectUtils.buildArtifactRepositories( superModel.getRepositories(),
artifactRepositoryFactory,
container );
for ( Iterator i = externalProfiles.iterator(); i.hasNext(); )
{
Profile externalProfile = (Profile) i.next();
for ( Iterator repoIterator = externalProfile.getRepositories().iterator(); repoIterator.hasNext(); )
{
Repository mavenRepo = (Repository) repoIterator.next();
ArtifactRepository artifactRepo = ProjectUtils.buildArtifactRepository( mavenRepo, artifactRepositoryFactory, container );
ArtifactRepository artifactRepo = ProjectUtils.buildArtifactRepository( mavenRepo,
artifactRepositoryFactory,
container );
if ( !aggregatedRemoteWagonRepositories.contains( artifactRepo ) )
{
@ -241,7 +246,7 @@ private MavenProject build( String pomLocation, Model model, ArtifactRepository
}
}
}
MavenProject project = assembleLineage( model, lineage, aggregatedRemoteWagonRepositories, localRepository );
// we don't have to force the collision exception for superModel here, it's already been done in getSuperModel()
@ -264,7 +269,8 @@ private MavenProject build( String pomLocation, Model model, ArtifactRepository
}
catch ( ModelInterpolationException e )
{
throw new ProjectBuildingException( "Error building project from \'" + pomLocation + "\': " + model.getId(), e );
throw new ProjectBuildingException( "Error building project from \'" + pomLocation + "\': " + model.getId(),
e );
}
return project;
}
@ -298,7 +304,8 @@ private void forcePluginExecutionIdCollision( Model model )
* the resolved source roots, etc for the parent - that occurs for the parent when it is constructed independently
* and projects are not cached or reused
*/
private MavenProject processProjectLogic( String pomLocation, MavenProject project, List remoteRepositories, List externalProfiles )
private MavenProject processProjectLogic( String pomLocation, MavenProject project, List remoteRepositories,
List externalProfiles )
throws ProjectBuildingException, ModelInterpolationException
{
Model model = project.getModel();
@ -308,45 +315,48 @@ private MavenProject processProjectLogic( String pomLocation, MavenProject proje
{
modelCache.put( key, model );
}
List activeProfiles = new ArrayList( externalProfiles );
List activePomProfiles = profileActivationCalculator.calculateActiveProfiles( model.getProfiles() );
activeProfiles.addAll( activePomProfiles );
Properties profileProperties = new Properties();
for ( Iterator it = activeProfiles.iterator(); it.hasNext(); )
{
Profile profile = (Profile) it.next();
modelInheritanceAssembler.mergeProfileWithModel( model, profile );
profileProperties.putAll( profile.getProperties() );
}
// TODO: Clean this up...we're using this to 'jump' the interpolation step for model properties not expressed in XML.
model = modelInterpolator.interpolate( model );
// interpolation is before injection, because interpolation is off-limits in the injected variables
modelDefaultsInjector.injectDefaults( model );
MavenProject parentProject = project.getParent();
project = new MavenProject( model );
project.addProfileProperties( profileProperties );
project.setActiveProfiles( activeProfiles );
project.setPluginArtifactRepositories( ProjectUtils.buildArtifactRepositories( model.getPluginRepositories(), artifactRepositoryFactory, container ) );
project.setPluginArtifactRepositories(
ProjectUtils.buildArtifactRepositories( model.getPluginRepositories(), artifactRepositoryFactory,
container ) );
DistributionManagement dm = model.getDistributionManagement();
if ( dm != null )
{
project.setDistributionManagementArtifactRepository( ProjectUtils.buildArtifactRepository( dm.getRepository(), artifactRepositoryFactory, container ) );
project.setDistributionManagementArtifactRepository(
ProjectUtils.buildArtifactRepository( dm.getRepository(), artifactRepositoryFactory, container ) );
}
project.setParent( parentProject );
@ -355,9 +365,7 @@ private MavenProject processProjectLogic( String pomLocation, MavenProject proje
{
Artifact parentArtifact = artifactFactory.createArtifact( parentProject.getGroupId(),
parentProject.getArtifactId(),
parentProject.getVersion(),
null,
"pom", null );
parentProject.getVersion(), null, "pom", null );
project.setParentArtifact( parentArtifact );
}
@ -369,7 +377,9 @@ private MavenProject processProjectLogic( String pomLocation, MavenProject proje
if ( validationResult.getMessageCount() > 0 )
{
throw new ProjectBuildingException( "Failed to validate POM for \'" + pomLocation + "\'.\n\n Reason(s):\n" + validationResult.render( " " ) );
throw new ProjectBuildingException(
"Failed to validate POM for \'" + pomLocation + "\'.\n\n Reason(s):\n" +
validationResult.render( " " ) );
}
return project;
@ -381,7 +391,8 @@ private MavenProject assembleLineage( Model model, LinkedList lineage, List aggr
{
if ( !model.getRepositories().isEmpty() )
{
List respositories = ProjectUtils.buildArtifactRepositories( model.getRepositories(), artifactRepositoryFactory, container );
List respositories = ProjectUtils.buildArtifactRepositories( model.getRepositories(),
artifactRepositoryFactory, container );
aggregatedRemoteWagonRepositories.addAll( respositories );
}
@ -447,12 +458,14 @@ private Model readModel( File file )
catch ( IOException e )
{
throw new ProjectBuildingException(
"Failed to build model from file '" + file.getAbsolutePath() + "'.\nError: \'" + e.getLocalizedMessage() + "\'", e );
"Failed to build model from file '" + file.getAbsolutePath() + "'.\nError: \'" +
e.getLocalizedMessage() + "\'", e );
}
catch ( XmlPullParserException e )
{
throw new ProjectBuildingException(
"Failed to parse model from file '" + file.getAbsolutePath() + "'.\nError: \'" + e.getLocalizedMessage() + "\'", e );
"Failed to parse model from file '" + file.getAbsolutePath() + "'.\nError: \'" +
e.getLocalizedMessage() + "\'", e );
}
finally
{
@ -471,11 +484,15 @@ private Model readModel( URL url )
}
catch ( IOException e )
{
throw new ProjectBuildingException( "Failed build model from URL \'" + url.toExternalForm() + "\'\nError: \'" + e.getLocalizedMessage() + "\'", e );
throw new ProjectBuildingException(
"Failed build model from URL \'" + url.toExternalForm() + "\'\nError: \'" + e.getLocalizedMessage() +
"\'", e );
}
catch ( XmlPullParserException e )
{
throw new ProjectBuildingException( "Failed to parse model from URL \'" + url.toExternalForm() + "\'\nError: \'" + e.getLocalizedMessage() + "\'", e );
throw new ProjectBuildingException(
"Failed to parse model from URL \'" + url.toExternalForm() + "\'\nError: \'" + e.getLocalizedMessage() +
"\'", e );
}
finally
{
@ -496,7 +513,8 @@ private static String createCacheKey( String groupId, String artifactId, String
protected Set createArtifacts( List dependencies )
{
// TODO: merge with MavenMetadataSource properly
return new MavenMetadataSource( artifactResolver, this, artifactFactory ).createArtifacts( dependencies, null, null );
return new MavenMetadataSource( artifactResolver, this, artifactFactory ).createArtifacts( dependencies, null,
null );
}
protected Set createPluginArtifacts( List plugins )
@ -510,15 +528,15 @@ protected Set createPluginArtifacts( List plugins )
String version;
if ( StringUtils.isEmpty( p.getVersion() ) )
{
version = ReleaseArtifactTransformation.RELEASE_VERSION;
version = "RELEASE";
}
else
{
version = p.getVersion();
}
Artifact artifact = artifactFactory.createArtifact( p.getGroupId(), p.getArtifactId(), version,
null, "maven-plugin", null );
Artifact artifact = artifactFactory.createArtifact( p.getGroupId(), p.getArtifactId(), version, null,
"maven-plugin", null );
if ( artifact != null )
{
pluginArtifacts.add( artifact );
@ -545,7 +563,8 @@ public MavenProject buildStandaloneSuperProject( ArtifactRepository localReposit
{
project.setFile( new File( ".", "pom.xml" ) );
List remoteRepositories = ProjectUtils.buildArtifactRepositories( superModel.getRepositories(), artifactRepositoryFactory, container );
List remoteRepositories = ProjectUtils.buildArtifactRepositories( superModel.getRepositories(),
artifactRepositoryFactory, container );
project = processProjectLogic( "<Super-POM>", project, remoteRepositories, externalProfiles );

View File

@ -34,12 +34,12 @@
import org.apache.maven.model.Model;
import org.apache.maven.model.Organization;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.model.Reporting;
import org.apache.maven.model.Scm;
import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.model.ReportSet;
import org.apache.maven.model.Reporting;
import org.apache.maven.model.Scm;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.codehaus.plexus.util.xml.Xpp3Dom;
@ -1036,11 +1036,12 @@ public void setExecutionProject( MavenProject executionProject )
{
this.executionProject = executionProject;
}
public void writeModel( Writer writer ) throws IOException
public void writeModel( Writer writer )
throws IOException
{
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
pomWriter.write( writer, getModel() );
}
}

View File

@ -44,8 +44,8 @@ MavenProject buildWithDependencies( File project, ArtifactRepository localReposi
/**
* Build the artifact from the local repository, resolving it if necessary.
*
* @param artifact the artifact description
* @param localRepository the local repository
* @param artifact the artifact description
* @param localRepository the local repository
* @param remoteArtifactRepositories the remote repository list
* @return the built project
* @throws ProjectBuildingException

View File

@ -17,12 +17,12 @@
*/
import org.apache.maven.model.Goal;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginContainer;
import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.Model;
import org.apache.maven.project.inheritance.ModelInheritanceAssembler;
import org.apache.maven.project.inheritance.DefaultModelInheritanceAssembler;
import org.apache.maven.project.inheritance.ModelInheritanceAssembler;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.util.ArrayList;

View File

@ -29,14 +29,13 @@
public final class ProjectUtils
{
private ProjectUtils()
{
}
public static List buildArtifactRepositories( List repositories,
ArtifactRepositoryFactory artifactRepositoryFactory,
PlexusContainer container )
ArtifactRepositoryFactory artifactRepositoryFactory,
PlexusContainer container )
throws ProjectBuildingException
{
@ -46,7 +45,8 @@ public static List buildArtifactRepositories( List repositories,
{
Repository mavenRepo = (Repository) i.next();
ArtifactRepository artifactRepo = buildArtifactRepository( mavenRepo, artifactRepositoryFactory, container );
ArtifactRepository artifactRepo = buildArtifactRepository( mavenRepo, artifactRepositoryFactory,
container );
if ( !repos.contains( artifactRepo ) )
{
@ -57,8 +57,8 @@ public static List buildArtifactRepositories( List repositories,
}
public static ArtifactRepository buildArtifactRepository( Repository repo,
ArtifactRepositoryFactory artifactRepositoryFactory,
PlexusContainer container )
ArtifactRepositoryFactory artifactRepositoryFactory,
PlexusContainer container )
throws ProjectBuildingException
{
if ( repo != null )
@ -67,11 +67,12 @@ public static ArtifactRepository buildArtifactRepository( Repository repo,
String url = repo.getUrl();
String snapshotPolicy = repo.getSnapshotPolicy();
String checksumPolicy = repo.getChecksumPolicy();
// TODO: make this a map inside the factory instead, so no lookup needed
ArtifactRepositoryLayout layout = getRepositoryLayout( repo, container );
return artifactRepositoryFactory.createArtifactRepository( id, url, layout, snapshotPolicy, checksumPolicy );
return artifactRepositoryFactory.createArtifactRepository( id, url, layout, snapshotPolicy,
checksumPolicy );
}
else
{
@ -91,8 +92,9 @@ private static ArtifactRepositoryLayout getRepositoryLayout( Repository mavenRep
}
catch ( ComponentLookupException e )
{
throw new ProjectBuildingException( "Cannot find layout implementation corresponding to: \'" + layout
+ "\' for remote repository with id: \'" + mavenRepo.getId() + "\'.", e );
throw new ProjectBuildingException(
"Cannot find layout implementation corresponding to: \'" + layout +
"\' for remote repository with id: \'" + mavenRepo.getId() + "\'.", e );
}
return repositoryLayout;
}

View File

@ -19,7 +19,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.metadata.AbstractArtifactMetadata;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@ -100,11 +99,6 @@ public void storeInLocalRepository( ArtifactRepository localRepository )
}
}
public void retrieveFromRemoteRepository( ArtifactRepository remoteRepository, WagonManager wagonManager )
{
// not used - TODO: again indicates bad design?
}
public String toString()
{
return "project information for " + artifact.getArtifactId() + " " + artifact.getVersion();

View File

@ -229,7 +229,8 @@ private void assembleModelBaseInheritance( ModelBase child, ModelBase parent )
if ( StringUtils.isEmpty( inherited ) || Boolean.valueOf( inherited ).booleanValue() )
{
ReportPlugin childReportPlugin = (ReportPlugin) childReportersByKey.get( parentReportPlugin.getKey() );
ReportPlugin childReportPlugin = (ReportPlugin) childReportersByKey.get(
parentReportPlugin.getKey() );
ReportPlugin mergedReportPlugin = parentReportPlugin;
@ -408,7 +409,7 @@ private void assembleBuildInheritance( Model child, Build parentBuild )
childBuild = new Build();
child.setBuild( childBuild );
}
// The build has been set but we want to step in here and fill in
// values that have not been set by the child.
@ -506,8 +507,8 @@ private void assembleScmInheritance( Model child, Model parent )
childScm.setConnection( appendPath( parentScm.getConnection(), child.getArtifactId() ) );
}
if ( StringUtils.isEmpty( childScm.getDeveloperConnection() )
&& !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) )
if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) &&
!StringUtils.isEmpty( parentScm.getDeveloperConnection() ) )
{
childScm
.setDeveloperConnection( appendPath( parentScm.getDeveloperConnection(), child.getArtifactId() ) );

View File

@ -28,6 +28,6 @@ public interface ModelInheritanceAssembler
String ROLE = ModelInheritanceAssembler.class.getName();
void assembleModelInheritance( Model child, Model parent );
void mergeProfileWithModel( Model model, Profile profile );
}

View File

@ -33,7 +33,6 @@
public class DefaultModelDefaultsInjector
implements ModelDefaultsInjector
{
public void injectDefaults( Model model )
{
injectDependencyDefaults( model.getDependencies(), model.getDependencyManagement() );

View File

@ -28,5 +28,5 @@ public interface ModelDefaultsInjector
void injectDefaults( Model model );
void mergePluginWithDefaults( Plugin plugin, Plugin def );
void mergePluginWithDefaults( Plugin plugin, Plugin def );
}

View File

@ -24,7 +24,6 @@
public class ModelInterpolationException
extends Exception
{
/**
* Added: Feb 2, 2005 by jdcasey
*/

View File

@ -25,7 +25,6 @@
*/
public interface ModelInterpolator
{
String ROLE = ModelInterpolator.class.getName();
Model interpolate( Model project )

View File

@ -34,7 +34,7 @@ public class DefaultModelValidator
public ModelValidationResult validate( Model model )
{
ModelValidationResult result = new ModelValidationResult();
validateStringNotEmpty( "modelVersion", result, model.getModelVersion() );
validateStringNotEmpty( "groupId", result, model.getGroupId() );

View File

@ -46,7 +46,7 @@ public String getMessage( int i )
{
return messages.get( i ).toString();
}
public List getMessages()
{
return Collections.unmodifiableList( messages );
@ -61,7 +61,7 @@ public String toString()
{
return render( "" );
}
public String render( String indentation )
{
if ( messages.size() == 0 )

View File

@ -1,6 +1,6 @@
<component-set>
<components>
<!--
<!--
|
|
|
@ -9,7 +9,7 @@
<role>org.apache.maven.project.interpolation.ModelInterpolator</role>
<implementation>org.apache.maven.project.interpolation.RegexBasedModelInterpolator</implementation>
</component>
<!--
<!--
|
|
|
@ -18,7 +18,7 @@
<role>org.apache.maven.project.injection.ModelDefaultsInjector</role>
<implementation>org.apache.maven.project.injection.DefaultModelDefaultsInjector</implementation>
</component>
<!--
<!--
|
|
|
@ -56,7 +56,7 @@
</requirement>
</requirements>
</component>
<!--
<!--
|
|
|
@ -65,7 +65,7 @@
<role>org.apache.maven.profiles.activation.ProfileActivationCalculator</role>
<implementation>org.apache.maven.profiles.activation.ProfileActivationCalculator</implementation>
</component>
<!--
<!--
|
|
|
@ -75,7 +75,7 @@
<role-hint>always-on</role-hint>
<implementation>org.apache.maven.profiles.activation.AlwaysOnProfileActivator</implementation>
</component>
<!--
<!--
|
|
|
@ -85,7 +85,7 @@
<role-hint>jdk-prefix</role-hint>
<implementation>org.apache.maven.profiles.activation.JdkPrefixProfileActivator</implementation>
</component>
<!--
<!--
|
|
|
@ -95,7 +95,7 @@
<role-hint>system-property</role-hint>
<implementation>org.apache.maven.profiles.activation.SystemPropertyProfileActivator</implementation>
</component>
<!--
<!--
|
|
|
@ -105,7 +105,7 @@
<role-hint>explicit-listing</role-hint>
<implementation>org.apache.maven.profiles.activation.ExplicitListingProfileActivator</implementation>
</component>
<!--
<!--
|
|
|
@ -114,7 +114,7 @@
<role>org.apache.maven.project.inheritance.ModelInheritanceAssembler</role>
<implementation>org.apache.maven.project.inheritance.DefaultModelInheritanceAssembler</implementation>
</component>
<!--
<!--
|
|
|
@ -124,7 +124,7 @@
<implementation>org.apache.maven.project.validation.DefaultModelValidator</implementation>
</component>
<!-- ********************* FIXME *******************************************
<!-- ********************* FIXME *******************************************
| I realize this is duplicated but allows the project builder to work by itself
-->
<component>

View File

@ -41,4 +41,4 @@
</testResources>
</build>
</project>
<!-- END SNIPPET: superpom -->
<!-- END SNIPPET: superpom -->

View File

@ -16,9 +16,10 @@
* limitations under the License.
*/
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.codehaus.plexus.PlexusTestCase;
import java.io.File;
@ -43,7 +44,7 @@ protected void setUp()
super.setUp();
projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );
artifactFactory = ( ArtifactFactory ) lookup( ArtifactFactory.ROLE );
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
}
// ----------------------------------------------------------------------
@ -84,8 +85,9 @@ protected ArtifactRepository getLocalRepository()
ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
"legacy" );
ArtifactRepository r = new ArtifactRepository( "local", "file://" + getLocalRepositoryPath().getAbsolutePath(),
repoLayout );
ArtifactRepository r = new DefaultArtifactRepository( "local",
"file://" + getLocalRepositoryPath().getAbsolutePath(),
repoLayout );
return r;
}

View File

@ -1,10 +1,9 @@
package org.apache.maven.project;
import junit.framework.TestCase;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
import junit.framework.TestCase;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
@ -24,7 +23,6 @@
public class ModelUtilsTest
extends TestCase
{
public void testShouldInheritOnePluginWithExecution()
{
Plugin parent = new Plugin();

View File

@ -24,7 +24,6 @@
public class ProjectBaseDirectoryAlignmentTest
extends MavenProjectTestCase
{
private String dir = "src/test/resources/projects/base-directory-alignment/";
public void testProjectDirectoryBaseDirectoryAlignment()

View File

@ -18,7 +18,6 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.factory.DefaultArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
@ -112,7 +111,8 @@ public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteR
ArtifactMetadataSource source, ArtifactFilter filter )
throws ArtifactResolutionException
{
return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source( artifactFactory ), filter );
return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source( artifactFactory ),
filter );
}
public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteRepositories,
@ -120,7 +120,8 @@ public ArtifactResolutionResult resolveTransitively( Set artifacts, List remoteR
ArtifactMetadataSource source )
throws ArtifactResolutionException
{
return super.resolveTransitively( artifacts, remoteRepositories, localRepository, new Source( artifactFactory ) );
return super.resolveTransitively( artifacts, remoteRepositories, localRepository,
new Source( artifactFactory ) );
}
public ArtifactResolutionResult resolveTransitively( Artifact artifact, List remoteRepositories,
@ -128,6 +129,7 @@ public ArtifactResolutionResult resolveTransitively( Artifact artifact, List rem
ArtifactMetadataSource source )
throws ArtifactResolutionException
{
return super.resolveTransitively( artifact, remoteRepositories, localRepository, new Source( artifactFactory ) );
return super.resolveTransitively( artifact, remoteRepositories, localRepository,
new Source( artifactFactory ) );
}
}

View File

@ -28,7 +28,6 @@
public class ProjectClasspathTest
extends MavenProjectTestCase
{
private String dir = "projects/scope/";
public void testProjectClasspath()

View File

@ -82,7 +82,8 @@ public void testShouldOverrideUnitTestExcludesOnly()
assembler.assembleModelInheritance( child, parent );
assertEquals( "source directory should be from parent", "src/main/java", child.getBuild().getSourceDirectory() );
assertEquals( "source directory should be from parent", "src/main/java",
child.getBuild().getSourceDirectory() );
assertEquals( "unit test source directory should be from parent", "src/test/java",
child.getBuild().getTestSourceDirectory() );
@ -322,45 +323,45 @@ public void testPluginInheritanceWhereParentPluginWithFalseInheritFlagAndChildHa
Model parent = makeBaseModel( "parent" );
Model child = makeBaseModel( "child" );
Plugin parentPlugin = new Plugin();
parentPlugin.setArtifactId("maven-testInheritance3-plugin");
parentPlugin.setGroupId("org.apache.maven.plugins");
parentPlugin.setVersion("1.0");
parentPlugin.setInherited("false");
List parentPlugins = Collections.singletonList(parentPlugin);
parentPlugin.setArtifactId( "maven-testInheritance3-plugin" );
parentPlugin.setGroupId( "org.apache.maven.plugins" );
parentPlugin.setVersion( "1.0" );
parentPlugin.setInherited( "false" );
List parentPlugins = Collections.singletonList( parentPlugin );
Build parentBuild = new Build();
parentBuild.setPlugins(parentPlugins);
parent.setBuild(parentBuild);
parentBuild.setPlugins( parentPlugins );
parent.setBuild( parentBuild );
assembler.assembleModelInheritance( child, parent );
assertPlugins( new ArrayList(), child );
}
private void assertPlugins( List expectedPlugins, Model child )
{
Build childBuild = child.getBuild();
if( expectedPlugins != null && !expectedPlugins.isEmpty() )
if ( expectedPlugins != null && !expectedPlugins.isEmpty() )
{
assertNotNull( childBuild );
Map childPluginsMap = childBuild.getPluginsAsMap();
if( childPluginsMap != null )
if ( childPluginsMap != null )
{
assertEquals( expectedPlugins.size(), childPluginsMap.size() );
for ( Iterator it = expectedPlugins.iterator(); it.hasNext(); )
{
Plugin expectedPlugin = (Plugin) it.next();
Plugin childPlugin = (Plugin) childPluginsMap.get( expectedPlugin.getKey() );
assertPluginsEqual( expectedPlugin, childPlugin );
}
}
@ -377,25 +378,26 @@ private void assertPlugins( List expectedPlugins, Model child )
private void assertPluginsEqual( Plugin reference, Plugin test )
{
assertEquals("Plugin keys don't match", reference.getKey(), test.getKey());
assertEquals("Plugin configurations don't match", reference.getConfiguration(), test.getConfiguration());
assertEquals( "Plugin keys don't match", reference.getKey(), test.getKey() );
assertEquals( "Plugin configurations don't match", reference.getConfiguration(), test.getConfiguration() );
List referenceGoals = reference.getGoals();
Map testGoalsMap = test.getGoalsAsMap();
if( referenceGoals != null && !referenceGoals.isEmpty() )
if ( referenceGoals != null && !referenceGoals.isEmpty() )
{
assertTrue( "Missing goals specification", ( testGoalsMap != null && !testGoalsMap.isEmpty() ) );
for ( Iterator it = referenceGoals.iterator(); it.hasNext(); )
{
Goal referenceGoal = (Goal) it.next();
Goal testGoal = (Goal) testGoalsMap.get( referenceGoal.getId() );
assertNotNull( "Goal from reference not found in test", testGoal );
assertEquals( "Goal IDs don't match", referenceGoal.getId(), testGoal.getId() );
assertEquals( "Goal configurations don't match", referenceGoal.getConfiguration(), testGoal.getConfiguration() );
assertEquals( "Goal configurations don't match", referenceGoal.getConfiguration(),
testGoal.getConfiguration() );
}
}
else
@ -500,7 +502,8 @@ private void assertRepositories( List expected, List actual )
if ( actualRepository.getId().equals( expectedRepository.getId() ) )
{
assertEquals( "Repository URLs don't match", expectedRepository.getUrl(), actualRepository.getUrl() );
assertEquals( "Repository URLs don't match", expectedRepository.getUrl(),
actualRepository.getUrl() );
found = true;
}
}

View File

@ -29,7 +29,6 @@
public class DefaultModelDefaultsInjectorTest
extends TestCase
{
public void testShouldConstructWithNoParams()
{
new DefaultModelDefaultsInjector();

View File

@ -34,8 +34,9 @@ public class DefaultModelValidatorTest
private Model model;
private ModelValidator validator;
public void testMissingModelVersion() throws Exception
public void testMissingModelVersion()
throws Exception
{
ModelValidationResult result = validate( "missing-modelVersion-pom.xml" );
@ -92,11 +93,11 @@ public void testMissingAll()
assertEquals( 4, result.getMessageCount() );
List messages = result.getMessages();
assertTrue( messages.contains("\'modelVersion\' is missing."));
assertTrue( messages.contains("\'groupId\' is missing."));
assertTrue( messages.contains("\'artifactId\' is missing."));
assertTrue( messages.contains("\'version\' is missing."));
assertTrue( messages.contains( "\'modelVersion\' is missing." ) );
assertTrue( messages.contains( "\'groupId\' is missing." ) );
assertTrue( messages.contains( "\'artifactId\' is missing." ) );
assertTrue( messages.contains( "\'version\' is missing." ) );
// type is inherited from the super pom
}

View File

@ -1,6 +1,6 @@
<plexus>
<components>
<!-- Due to PLX-108, have to work around it...
<!-- Due to PLX-108, have to work around it...
<component>
<role>org.apache.maven.artifact.ArtifactResolver</role>
<implementation>org.apache.maven.project.ProjectClasspathArtifactResolver</implementation>
@ -24,6 +24,9 @@
<requirement>
<role>org.apache.maven.artifact.factory.ArtifactFactory</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.resolver.ArtifactCollector</role>
</requirement>
</requirements>
</component>
</components>

View File

@ -105,6 +105,7 @@
<module>maven-archetype</module>
<module>maven-archiver</module>
<module>maven-artifact</module>
<module>maven-artifact-manager</module>
<module>maven-artifact-ant</module>
<module>maven-artifact-test</module>
<module>maven-core</module>