| Method from org.apache.maven.project.MavenProject Detail: |
public void addAttachedArtifact(Artifact artifact) {
getAttachedArtifacts().add( artifact );
}
|
public void addCompileSourceRoot(String path) {
if ( path != null )
{
path = path.trim();
if ( path.length() != 0 )
{
if ( !getCompileSourceRoots().contains( path ) )
{
getCompileSourceRoots().add( path );
}
}
}
}
|
public void addContributor(Contributor contributor) {
getModel().addContributor( contributor );
}
|
public void addDeveloper(Developer developer) {
getModel().addDeveloper( developer );
}
|
public void addLicense(License license) {
getModel().addLicense( license );
}
|
public void addMailingList(MailingList mailingList) {
getModel().addMailingList( mailingList );
}
|
public void addPlugin(Plugin plugin) {
Build build = getModelBuild();
if ( !build.getPluginsAsMap().containsKey( plugin.getKey() ) )
{
injectPluginManagementInfo( plugin );
build.addPlugin( plugin );
build.flushPluginMap();
}
}
|
public void addProjectReference(MavenProject project) {
projectReferences.put( getProjectReferenceId( project.getGroupId(), project.getArtifactId(), project.getVersion() ), project );
}
|
public void addResource(Resource resource) {
getBuild().addResource( resource );
}
|
public void addScriptSourceRoot(String path) {
if ( path != null )
{
path = path.trim();
if ( path.length() != 0 )
{
if ( !getScriptSourceRoots().contains( path ) )
{
getScriptSourceRoots().add( path );
}
}
}
}
|
public void addTestCompileSourceRoot(String path) {
if ( path != null )
{
path = path.trim();
if ( path.length() != 0 )
{
if ( !getTestCompileSourceRoots().contains( path ) )
{
getTestCompileSourceRoots().add( path );
}
}
}
}
|
public void addTestResource(Resource testResource) {
getBuild().addTestResource( testResource );
}
|
public void attachArtifact(String type,
String classifier,
File file) {
} Deprecated! Use - MavenProjectHelper.attachArtifact(..) instead.
|
public Object clone() throws CloneNotSupportedException {
MavenProject clone = (MavenProject) super.clone();
clone.deepCopy( this );
return clone;
}
|
public Set createArtifacts(ArtifactFactory artifactFactory,
String inheritedScope,
ArtifactFilter dependencyFilter) throws InvalidDependencyVersionException {
return MavenMetadataSource.createArtifacts( artifactFactory, getDependencies(), inheritedScope,
dependencyFilter, this );
}
|
public boolean equals(Object other) {
if ( other == this )
{
return true;
}
else if ( !( other instanceof MavenProject ) )
{
return false;
}
else
{
MavenProject otherProject = (MavenProject) other;
return getId().equals( otherProject.getId() );
}
}
|
public List getActiveProfiles() {
return activeProfiles;
}
|
public Artifact getArtifact() {
return artifact;
}
|
public String getArtifactId() {
return getModel().getArtifactId();
}
|
public Map getArtifactMap() {
if ( artifactMap == null )
{
artifactMap = ArtifactUtils.artifactMapByVersionlessId( getArtifacts() );
}
return artifactMap;
}
|
public Set getArtifacts() {
return artifacts == null ? Collections.EMPTY_SET : artifacts;
}
All dependencies that this project has, including transitive ones.
Contents are lazily populated, so depending on what phases have run dependencies in some scopes won't be included.
eg. if only compile phase has run, dependencies with scope test won't be included. |
public List getAttachedArtifacts() {
if ( attachedArtifacts == null )
{
attachedArtifacts = new ArrayList();
}
return attachedArtifacts;
}
|
public File getBasedir() {
if ( getFile() != null )
{
return getFile().getParentFile();
}
else
{
// repository based POM
return null;
}
}
|
public Build getBuild() {
if ( buildOverlay == null )
{
buildOverlay = new BuildOverlay( getModelBuild() );
}
return buildOverlay;
}
|
public List getBuildExtensions() {
Build build = getBuild();
if ( build == null || build.getExtensions() == null )
{
return Collections.EMPTY_LIST;
}
else
{
return build.getExtensions();
}
}
|
public List getBuildPlugins() {
if ( getModel().getBuild() == null )
{
return null;
}
return getModel().getBuild().getPlugins();
}
|
public CiManagement getCiManagement() {
return getModel().getCiManagement();
}
|
public List getCollectedProjects() {
return collectedProjects;
}
|
public List getCompileArtifacts() {
List list = new ArrayList( getArtifacts().size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: classpath check doesn't belong here - that's the other method
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) ||
Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
{
list.add( a );
}
}
}
return list;
}
|
public List getCompileClasspathElements() throws DependencyResolutionRequiredException {
List list = new ArrayList( getArtifacts().size() );
list.add( getBuild().getOutputDirectory() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) ||
Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
{
addArtifactPath( a, list );
}
}
}
return list;
}
|
public List getCompileDependencies() {
Set artifacts = getArtifacts();
if ( artifacts == null || artifacts.isEmpty() )
{
return Collections.EMPTY_LIST;
}
List list = new ArrayList( artifacts.size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) ||
Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
{
Dependency dependency = new Dependency();
dependency.setArtifactId( a.getArtifactId() );
dependency.setGroupId( a.getGroupId() );
dependency.setVersion( a.getVersion() );
dependency.setScope( a.getScope() );
dependency.setType( a.getType() );
dependency.setClassifier( a.getClassifier() );
list.add( dependency );
}
}
return list;
}
|
public List getCompileSourceRoots() {
return compileSourceRoots;
}
|
public List getContributors() {
return getModel().getContributors();
}
|
public String getDefaultGoal() {
return getBuild() != null ? getBuild().getDefaultGoal() : null;
}
|
public List getDependencies() {
return getModel().getDependencies();
}
|
public Set getDependencyArtifacts() {
return dependencyArtifacts;
}
Direct dependencies that this project has. |
public DependencyManagement getDependencyManagement() {
return getModel().getDependencyManagement();
}
|
public String getDescription() {
return getModel().getDescription();
}
|
public List getDevelopers() {
return getModel().getDevelopers();
}
|
public DistributionManagement getDistributionManagement() {
return getModel().getDistributionManagement();
}
|
public ArtifactRepository getDistributionManagementArtifactRepository() {
return getArtifact().isSnapshot() && ( getSnapshotArtifactRepository() != null ) ? getSnapshotArtifactRepository()
: getReleaseArtifactRepository();
}
|
public MavenProject getExecutionProject() {
return executionProject;
}
|
public Map getExtensionArtifactMap() {
if ( extensionArtifactMap == null )
{
extensionArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getExtensionArtifacts() );
}
return extensionArtifactMap;
}
|
public Set getExtensionArtifacts() {
return this.extensionArtifacts;
}
|
public File getFile() {
return file;
}
|
public List getFilters() {
return getBuild().getFilters();
}
|
public Xpp3Dom getGoalConfiguration(String pluginGroupId,
String pluginArtifactId,
String executionId,
String goalId) {
Xpp3Dom dom = null;
// ----------------------------------------------------------------------
// I would like to be able to lookup the Mojo object using a key but
// we have a limitation in modello that will be remedied shortly. So
// for now I have to iterate through and see what we have.
// ----------------------------------------------------------------------
if ( getBuildPlugins() != null )
{
for ( Iterator iterator = getBuildPlugins().iterator(); iterator.hasNext(); )
{
Plugin plugin = (Plugin) iterator.next();
if ( pluginGroupId.equals( plugin.getGroupId() ) && pluginArtifactId.equals( plugin.getArtifactId() ) )
{
dom = (Xpp3Dom) plugin.getConfiguration();
if ( executionId != null )
{
PluginExecution execution = (PluginExecution) plugin.getExecutionsAsMap().get( executionId );
if ( execution != null )
{
Xpp3Dom executionConfiguration = (Xpp3Dom) execution.getConfiguration();
if ( executionConfiguration != null )
{
Xpp3Dom newDom = new Xpp3Dom( executionConfiguration );
dom = Xpp3Dom.mergeXpp3Dom( newDom, dom );
}
}
}
break;
}
}
}
if ( dom != null )
{
// make a copy so the original in the POM doesn't get messed with
dom = new Xpp3Dom( dom );
}
return dom;
}
|
public String getGroupId() {
String groupId = getModel().getGroupId();
if ( ( groupId == null ) && ( getModel().getParent() != null ) )
{
groupId = getModel().getParent().getGroupId();
}
return groupId;
}
|
public String getId() {
return getModel().getId();
}
|
public String getInceptionYear() {
return getModel().getInceptionYear();
}
|
public IssueManagement getIssueManagement() {
return getModel().getIssueManagement();
}
|
public List getLicenses() {
return getModel().getLicenses();
}
|
public List getMailingLists() {
return getModel().getMailingLists();
}
|
public Map getManagedVersionMap() {
return this.managedVersionMap;
}
|
public Model getModel() {
return model;
}
|
public String getModelVersion() {
return getModel().getModelVersion();
}
|
public String getModulePathAdjustment(MavenProject moduleProject) throws IOException {
// FIXME: This is hacky. What if module directory doesn't match artifactid, and parent
// is coming from the repository??
// FIXME: If there is a hierarchy of three projects, with the url specified at the top,
// and the top two projects are referenced from copies that are in the repository, the
// middle-level POM doesn't have a File associated with it (or the file's directory is
// of an unexpected name), and module path adjustments fail.
String module = moduleProject.getArtifactId();
File moduleFile = moduleProject.getFile();
if ( moduleFile != null )
{
File moduleDir = moduleFile.getCanonicalFile().getParentFile();
module = moduleDir.getName();
}
if ( moduleAdjustments == null )
{
moduleAdjustments = new HashMap();
List modules = getModules();
if ( modules != null )
{
for ( Iterator it = modules.iterator(); it.hasNext(); )
{
String modulePath = (String) it.next();
String moduleName = modulePath;
if ( moduleName.endsWith( "/" ) || moduleName.endsWith( "\\" ) )
{
moduleName = moduleName.substring( 0, moduleName.length() - 1 );
}
int lastSlash = moduleName.lastIndexOf( '/" );
if ( lastSlash < 0 )
{
lastSlash = moduleName.lastIndexOf( '\\" );
}
String adjustment = null;
if ( lastSlash > -1 )
{
moduleName = moduleName.substring( lastSlash + 1 );
adjustment = modulePath.substring( 0, lastSlash );
}
moduleAdjustments.put( moduleName, adjustment );
}
}
}
return (String) moduleAdjustments.get( module );
}
|
public List getModules() {
return getModel().getModules();
}
|
public String getName() {
// TODO: this should not be allowed to be null.
if ( getModel().getName() != null )
{
return getModel().getName();
}
else
{
return "Unnamed - " + getId();
}
}
|
public Organization getOrganization() {
return getModel().getOrganization();
}
|
public Model getOriginalModel() {
return originalModel;
}
|
public String getPackaging() {
return getModel().getPackaging();
}
|
public MavenProject getParent() {
return parent;
}
|
public Artifact getParentArtifact() {
return parentArtifact;
}
|
public Map getPluginArtifactMap() {
if ( pluginArtifactMap == null )
{
pluginArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getPluginArtifacts() );
}
return pluginArtifactMap;
}
|
public List getPluginArtifactRepositories() {
return pluginArtifactRepositories;
}
|
public Set getPluginArtifacts() {
return pluginArtifacts;
}
|
public PluginManagement getPluginManagement() {
PluginManagement pluginMgmt = null;
Build build = getModel().getBuild();
if ( build != null )
{
pluginMgmt = build.getPluginManagement();
}
return pluginMgmt;
}
|
public List getPluginRepositories() {
return getModel().getPluginRepositories();
}
|
public Prerequisites getPrerequisites() {
return getModel().getPrerequisites();
}
|
public Map getProjectReferences() {
return projectReferences;
}
|
public Properties getProperties() {
return getModel().getProperties();
}
|
protected ArtifactRepository getReleaseArtifactRepository() {
return releaseArtifactRepository;
}
|
public List getRemoteArtifactRepositories() {
return remoteArtifactRepositories;
}
|
public Map getReportArtifactMap() {
if ( reportArtifactMap == null )
{
reportArtifactMap = ArtifactUtils.artifactMapByVersionlessId( getReportArtifacts() );
}
return reportArtifactMap;
}
|
public Set getReportArtifacts() {
return reportArtifacts;
}
|
public Xpp3Dom getReportConfiguration(String pluginGroupId,
String pluginArtifactId,
String reportSetId) {
Xpp3Dom dom = null;
// ----------------------------------------------------------------------
// I would like to be able to lookup the Mojo object using a key but
// we have a limitation in modello that will be remedied shortly. So
// for now I have to iterate through and see what we have.
// ----------------------------------------------------------------------
if ( getReportPlugins() != null )
{
for ( Iterator iterator = getReportPlugins().iterator(); iterator.hasNext(); )
{
ReportPlugin plugin = (ReportPlugin) iterator.next();
if ( pluginGroupId.equals( plugin.getGroupId() ) && pluginArtifactId.equals( plugin.getArtifactId() ) )
{
dom = (Xpp3Dom) plugin.getConfiguration();
if ( reportSetId != null )
{
ReportSet reportSet = (ReportSet) plugin.getReportSetsAsMap().get( reportSetId );
if ( reportSet != null )
{
Xpp3Dom executionConfiguration = (Xpp3Dom) reportSet.getConfiguration();
if ( executionConfiguration != null )
{
Xpp3Dom newDom = new Xpp3Dom( executionConfiguration );
dom = Xpp3Dom.mergeXpp3Dom( newDom, dom );
}
}
}
break;
}
}
}
if ( dom != null )
{
// make a copy so the original in the POM doesn't get messed with
dom = new Xpp3Dom( dom );
}
return dom;
}
|
public List getReportPlugins() {
if ( getModel().getReporting() == null )
{
return null;
}
return getModel().getReporting().getPlugins();
}
|
public Reporting getReporting() {
return getModel().getReporting();
}
|
public List getRepositories() {
return getModel().getRepositories();
}
|
public List getResources() {
return getBuild().getResources();
}
|
public List getRuntimeArtifacts() {
List list = new ArrayList( getArtifacts().size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: classpath check doesn't belong here - that's the other method
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
{
list.add( a );
}
}
}
return list;
}
|
public List getRuntimeClasspathElements() throws DependencyResolutionRequiredException {
List list = new ArrayList( getArtifacts().size() + 1 );
list.add( getBuild().getOutputDirectory() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
{
File file = a.getFile();
if ( file == null )
{
throw new DependencyResolutionRequiredException( a );
}
list.add( file.getPath() );
}
}
}
return list;
}
|
public List getRuntimeDependencies() {
Set artifacts = getArtifacts();
if ( artifacts == null || artifacts.isEmpty() )
{
return Collections.EMPTY_LIST;
}
List list = new ArrayList( artifacts.size() );
for ( Iterator i = artifacts.iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
{
Dependency dependency = new Dependency();
dependency.setArtifactId( a.getArtifactId() );
dependency.setGroupId( a.getGroupId() );
dependency.setVersion( a.getVersion() );
dependency.setScope( a.getScope() );
dependency.setType( a.getType() );
dependency.setClassifier( a.getClassifier() );
list.add( dependency );
}
}
return list;
}
|
public Scm getScm() {
return getModel().getScm();
}
|
public List getScriptSourceRoots() {
return scriptSourceRoots;
}
|
protected ArtifactRepository getSnapshotArtifactRepository() {
return snapshotArtifactRepository;
}
|
public List getSystemArtifacts() {
List list = new ArrayList( getArtifacts().size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: classpath check doesn't belong here - that's the other method
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
{
list.add( a );
}
}
}
return list;
}
|
public List getSystemClasspathElements() throws DependencyResolutionRequiredException {
List list = new ArrayList( getArtifacts().size() );
list.add( getBuild().getOutputDirectory() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
{
addArtifactPath( a, list );
}
}
}
return list;
}
|
public List getSystemDependencies() {
Set artifacts = getArtifacts();
if ( artifacts == null || artifacts.isEmpty() )
{
return Collections.EMPTY_LIST;
}
List list = new ArrayList( artifacts.size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: let the scope handler deal with this
if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
{
Dependency dependency = new Dependency();
dependency.setArtifactId( a.getArtifactId() );
dependency.setGroupId( a.getGroupId() );
dependency.setVersion( a.getVersion() );
dependency.setScope( a.getScope() );
dependency.setType( a.getType() );
dependency.setClassifier( a.getClassifier() );
list.add( dependency );
}
}
return list;
}
|
public List getTestArtifacts() {
List list = new ArrayList( getArtifacts().size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: classpath check doesn't belong here - that's the other method
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
// NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
// this check...
// if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
// Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
// {
// list.add( a );
// }
list.add( a );
}
}
return list;
}
|
public List getTestClasspathElements() throws DependencyResolutionRequiredException {
List list = new ArrayList( getArtifacts().size() + 1 );
list.add( getBuild().getTestOutputDirectory() );
list.add( getBuild().getOutputDirectory() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
if ( a.getArtifactHandler().isAddedToClasspath() )
{
// TODO: let the scope handler deal with this
// NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
// this check...
// if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
// Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
// {
// }
File file = a.getFile();
if ( file == null )
{
throw new DependencyResolutionRequiredException( a );
}
list.add( file.getPath() );
}
}
return list;
}
|
public List getTestCompileSourceRoots() {
return testCompileSourceRoots;
}
|
public List getTestDependencies() {
Set artifacts = getArtifacts();
if ( artifacts == null || artifacts.isEmpty() )
{
return Collections.EMPTY_LIST;
}
List list = new ArrayList( artifacts.size() );
for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
// TODO: let the scope handler deal with this
// NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
// this check...
// if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
// Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
// {
// }
Dependency dependency = new Dependency();
dependency.setArtifactId( a.getArtifactId() );
dependency.setGroupId( a.getGroupId() );
dependency.setVersion( a.getVersion() );
dependency.setScope( a.getScope() );
dependency.setType( a.getType() );
dependency.setClassifier( a.getClassifier() );
list.add( dependency );
}
return list;
}
|
public List getTestResources() {
return getBuild().getTestResources();
}
|
public String getUrl() {
return getModel().getUrl();
}
|
public String getVersion() {
String version = getModel().getVersion();
if ( ( version == null ) && ( getModel().getParent() != null ) )
{
version = getModel().getParent().getVersion();
}
return version;
}
|
public boolean hasParent() {
return getParent() != null;
}
|
public int hashCode() {
return getId().hashCode();
}
|
public void injectPluginManagementInfo(Plugin plugin) {
PluginManagement pm = getModelBuild().getPluginManagement();
if ( pm != null )
{
Map pmByKey = pm.getPluginsAsMap();
String pluginKey = plugin.getKey();
if ( pmByKey != null && pmByKey.containsKey( pluginKey ) )
{
Plugin pmPlugin = (Plugin) pmByKey.get( pluginKey );
ModelUtils.mergePluginDefinitions( plugin, pmPlugin, false );
}
}
}
|
public boolean isExecutionRoot() {
return executionRoot;
}
|
public Artifact replaceWithActiveArtifact(Artifact pluginArtifact) {
if ( getProjectReferences() != null && !getProjectReferences().isEmpty() )
{
String refId = getProjectReferenceId( pluginArtifact.getGroupId(), pluginArtifact.getArtifactId(), pluginArtifact.getVersion() );
MavenProject ref = (MavenProject) getProjectReferences().get( refId );
if ( ref != null && ref.getArtifact() != null )
{
// TODO: if not matching, we should get the correct artifact from that project (attached)
if ( ref.getArtifact().getDependencyConflictId().equals( pluginArtifact.getDependencyConflictId() ) )
{
// if the project artifact doesn't exist, don't use it. We haven't built that far.
if ( ref.getArtifact().getFile() != null && ref.getArtifact().getFile().exists() )
{
pluginArtifact = new ActiveProjectArtifact( ref, pluginArtifact );
return pluginArtifact;
}
else
{
/* TODO...
logger.warn( "Artifact found in the reactor has not been built when it's use was " +
"attempted - resolving from the repository instead" );
*/
}
}
Iterator itr = ref.getAttachedArtifacts().iterator();
while(itr.hasNext()) {
Artifact attached = (Artifact) itr.next();
if( attached.getDependencyConflictId().equals(pluginArtifact.getDependencyConflictId()) ) {
/* TODO: if I use the original, I get an exception below:
java.lang.UnsupportedOperationException: Cannot change the download information for an attached artifact. It is derived from the main artifact.
at org.apache.maven.project.artifact.AttachedArtifact.setDownloadUrl(AttachedArtifact.java:89)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:205)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:275)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:67)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:223)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:211)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:182)
at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1117)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:366)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
*/
Artifact resultArtifact=ArtifactUtils.copyArtifact(attached);
resultArtifact.setScope(pluginArtifact.getScope());
return resultArtifact;
}
}
}
}
return pluginArtifact;
}
|
public void setActiveProfiles(List activeProfiles) {
this.activeProfiles.addAll( activeProfiles );
}
|
public void setArtifact(Artifact artifact) {
this.artifact = artifact;
}
|
public void setArtifactId(String artifactId) {
getModel().setArtifactId( artifactId );
}
|
public void setArtifacts(Set artifacts) {
this.artifacts = artifacts;
// flush the calculated artifactMap
this.artifactMap = null;
}
|
protected void setAttachedArtifacts(List attachedArtifacts) {
this.attachedArtifacts = attachedArtifacts;
}
|
public void setBuild(Build build) {
this.buildOverlay = new BuildOverlay( build );
getModel().setBuild( build );
}
|
public void setCiManagement(CiManagement ciManagement) {
getModel().setCiManagement( ciManagement );
}
|
public void setCollectedProjects(List collectedProjects) {
this.collectedProjects = collectedProjects;
}
|
protected void setCompileSourceRoots(List compileSourceRoots) {
this.compileSourceRoots = compileSourceRoots;
}
|
public void setContributors(List contributors) {
getModel().setContributors( contributors );
}
|
public void setDependencies(List dependencies) {
getModel().setDependencies( dependencies );
}
|
public void setDependencyArtifacts(Set dependencyArtifacts) {
this.dependencyArtifacts = dependencyArtifacts;
}
|
public void setDescription(String description) {
getModel().setDescription( description );
}
|
public void setDevelopers(List developers) {
getModel().setDevelopers( developers );
}
|
public void setDistributionManagement(DistributionManagement distributionManagement) {
getModel().setDistributionManagement( distributionManagement );
}
|
public void setExecutionProject(MavenProject executionProject) {
this.executionProject = executionProject;
}
|
public void setExecutionRoot(boolean executionRoot) {
this.executionRoot = executionRoot;
}
|
public void setExtensionArtifacts(Set extensionArtifacts) {
this.extensionArtifacts = extensionArtifacts;
this.extensionArtifactMap = null;
}
|
public void setFile(File file) {
this.file = file;
}
|
public void setGroupId(String groupId) {
getModel().setGroupId( groupId );
}
|
public void setInceptionYear(String inceptionYear) {
getModel().setInceptionYear( inceptionYear );
}
|
public void setIssueManagement(IssueManagement issueManagement) {
getModel().setIssueManagement( issueManagement );
}
|
public void setLicenses(List licenses) {
getModel().setLicenses( licenses );
}
|
public void setMailingLists(List mailingLists) {
getModel().setMailingLists( mailingLists );
}
|
public void setManagedVersionMap(Map map) {
this.managedVersionMap = map;
}
|
protected void setModel(Model model) {
this.model = model;
}
|
public void setModelVersion(String pomVersion) {
getModel().setModelVersion( pomVersion );
}
|
public void setName(String name) {
getModel().setName( name );
}
|
public void setOrganization(Organization organization) {
getModel().setOrganization( organization );
}
|
public void setOriginalModel(Model originalModel) {
this.originalModel = originalModel;
}
|
public void setPackaging(String packaging) {
getModel().setPackaging( packaging );
}
|
public void setParent(MavenProject parent) {
this.parent = parent;
}
|
public void setParentArtifact(Artifact parentArtifact) {
this.parentArtifact = parentArtifact;
}
|
public void setPluginArtifactRepositories(List pluginArtifactRepositories) {
this.pluginArtifactRepositories = pluginArtifactRepositories;
}
|
public void setPluginArtifacts(Set pluginArtifacts) {
this.pluginArtifacts = pluginArtifacts;
this.pluginArtifactMap = null;
}
|
public void setReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository) {
this.releaseArtifactRepository = releaseArtifactRepository;
}
|
public void setRemoteArtifactRepositories(List remoteArtifactRepositories) {
this.remoteArtifactRepositories = remoteArtifactRepositories;
}
|
public void setReportArtifacts(Set reportArtifacts) {
this.reportArtifacts = reportArtifacts;
this.reportArtifactMap = null;
}
|
public void setReporting(Reporting reporting) {
getModel().setReporting( reporting );
}
|
public void setScm(Scm scm) {
getModel().setScm( scm );
}
|
protected void setScriptSourceRoots(List scriptSourceRoots) {
this.scriptSourceRoots = scriptSourceRoots;
}
|
public void setSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository) {
this.snapshotArtifactRepository = snapshotArtifactRepository;
}
|
protected void setTestCompileSourceRoots(List testCompileSourceRoots) {
this.testCompileSourceRoots = testCompileSourceRoots;
}
|
public void setUrl(String url) {
getModel().setUrl( url );
}
|
public void setVersion(String version) {
getModel().setVersion( version );
}
|
public String toString() {
StringBuffer sb = new StringBuffer(30);
sb.append( "MavenProject: " );
sb.append( this.getGroupId() );
sb.append( ":" );
sb.append( this.getArtifactId() );
sb.append( ":" );
sb.append( this.getVersion() );
sb.append( " @ " );
try
{
sb.append( this.getFile().getPath() );
}
catch (NullPointerException e)
{
//don't log it.
}
return sb.toString();
}
|
public void writeModel(Writer writer) throws IOException {
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
pomWriter.write( writer, getModel() );
}
|
public void writeOriginalModel(Writer writer) throws IOException {
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
pomWriter.write( writer, getOriginalModel() );
}
|