Correcting core-library resolution

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@225208 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-07-25 23:50:13 +00:00
parent cfccde2596
commit 3251b41d8e
1 changed files with 21 additions and 7 deletions

View File

@ -572,7 +572,7 @@ public class DefaultPluginManager
unresolved.removeAll( resolved );
resolveCoreArtifacts( unresolved );
resolveCoreArtifacts( unresolved, project.getRemoteArtifactRepositories(), localRepository );
List allResolved = new ArrayList( resolved.size() + unresolved.size() );
@ -598,8 +598,8 @@ public class DefaultPluginManager
private Map resolvedCoreArtifactFiles = new HashMap();
private void resolveCoreArtifacts( List unresolved )
throws PluginConfigurationException
private void resolveCoreArtifacts( List unresolved, List remoteRepositories, ArtifactRepository localRepository )
throws ArtifactResolutionException
{
for ( Iterator it = unresolved.iterator(); it.hasNext(); )
{
@ -616,14 +616,28 @@ public class DefaultPluginManager
if ( resourceUrl == null )
{
throw new PluginConfigurationException( "Cannot resolve core artifact: " + artifact.getId() );
artifactResolver.resolve( artifact, unresolved, localRepository );
artifactFile = artifact.getFile();
}
else
{
String artifactPath = resourceUrl.getPath();
String artifactPath = resourceUrl.getPath();
artifactPath = artifactPath.substring( 0, artifactPath.length() - resource.length() );
if ( artifactPath.endsWith( "/" ) )
{
artifactPath = artifactPath.substring( 0, artifactPath.length() - 1 );
}
artifactPath = artifactPath.substring( 0, artifactPath.length() - resource.length() );
if ( artifactPath.endsWith( "!" ) )
{
artifactPath = artifactPath.substring( 0, artifactPath.length() - 1 );
}
artifactFile = new File( artifactPath );
artifactFile = new File( artifactPath ).getAbsoluteFile();
}
resolvedCoreArtifactFiles.put( artifact.getId(), artifactFile );
}