o adding some methods to create artifacts

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@330997 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-11-05 13:53:33 +00:00
parent 9cacd22ae5
commit 75731b688d
1 changed files with 20 additions and 0 deletions

View File

@ -24,6 +24,8 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
@ -112,6 +114,8 @@ public class MavenEmbedder
private PluginDescriptorBuilder pluginDescriptorBuilder;
private ArtifactFactory artifactFactory;
// ----------------------------------------------------------------------
// Configuration
// ----------------------------------------------------------------------
@ -327,6 +331,20 @@ public class MavenEmbedder
return projects;
}
// ----------------------------------------------------------------------
// Artifacts
// ----------------------------------------------------------------------
public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
{
return artifactFactory.createArtifact( groupId, artifactId, version, scope, type );
}
public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, String classifier )
{
return artifactFactory.createArtifact( groupId, artifactId, version, type, classifier );
}
// ----------------------------------------------------------------------
// Plugins
// ----------------------------------------------------------------------
@ -603,6 +621,8 @@ public class MavenEmbedder
wagonManager = (WagonManager) embedder.lookup( WagonManager.ROLE );
artifactFactory = (ArtifactFactory) embedder.lookup( ArtifactFactory.ROLE );
// ----------------------------------------------------------------------
// If an explicit local repository has not been set then we will use the
// setting builder to use the maven defaults to help us find one.