You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2008/01/19 23:05:01 UTC
svn commit: r613467 -
/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/PomMetadataSource.java
Author: jvanzyl
Date: Sat Jan 19 14:05:01 2008
New Revision: 613467
URL: http://svn.apache.org/viewvc?rev=613467&view=rev
Log:
o patch from Oleg for metadata processing required by a maven-artifact provider
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/PomMetadataSource.java
Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/PomMetadataSource.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/PomMetadataSource.java?rev=613467&r1=613466&r2=613467&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/PomMetadataSource.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/PomMetadataSource.java Sat Jan 19 14:05:01 2008
@@ -52,7 +52,8 @@
*/
public class PomMetadataSource
extends AbstractLogEnabled
- implements MetadataSource, Contextualizable
+ implements MetadataSource,
+ Contextualizable
{
public static final String ROLE_HINT = "default";
@@ -85,17 +86,24 @@
MavenProject project = null;
- Artifact pomArtifact = artifactFactory.createProjectArtifact( artifactMetadata.getGroupId(), artifactMetadata.getArtifactId(),
- artifactMetadata.getVersion(), artifactMetadata.getScope() );
+ Artifact pomArtifact = artifactFactory.createProjectArtifact(
+ artifactMetadata.getGroupId()
+ , artifactMetadata.getArtifactId()
+ , artifactMetadata.getVersion()
+ );
try
{
project = mavenProjectBuilder.buildFromRepository( pomArtifact, remoteRepositories, localRepository );
+ if ( pomArtifact.getFile() != null )
+ {
+ artifactMetadata.setArtifactUri( pomArtifact.getFile().toURI().toString() );
+ }
}
catch ( InvalidProjectModelException e )
{
// We want to capture this in the graph so that we can display the error to the user
- artifactMetadata.setError( e.getMessage() );
+ artifactMetadata.setError( e.getMessage() );
}
catch ( ProjectBuildingException e )
{
@@ -112,7 +120,9 @@
for ( Iterator i = project.getDependencies().iterator(); i.hasNext(); )
{
Dependency d = (Dependency) i.next();
- artifacts.add( new ArtifactMetadata( d.getGroupId(), d.getArtifactId(), d.getVersion() ) );
+
+ artifacts.add( new ArtifactMetadata( d.getGroupId(), d.getArtifactId(), d.getVersion(), d.getType(),
+ d.getScope(), d.getClassifier(), null, null, false, null ) );
}
// The remote repositories is intentially null here while working in the graph in the least invasive way
@@ -120,6 +130,7 @@
// repositories lingering around or being aggregated after they are used. jvz
artifactMetadata.setDependencies( artifacts );
+
return new MetadataResolution( artifactMetadata );
}