Class MavenProject
- java.lang.Object
-
- org.apache.maven.project.MavenProject
-
- All Implemented Interfaces:
java.lang.Cloneable
public class MavenProject extends java.lang.Object implements java.lang.Cloneable
The concern of the project is provide runtime values based on the model.The values in the model remain untouched but during the process of building a project notions like inheritance and interpolation can be added. This allows to have an entity which is useful in a runtime while preserving the model so that it can be marshalled and unmarshalled without being tainted by runtime requirements.
With changes during 3.2.2 release MavenProject is closer to being immutable after construction with the removal of all components from this class, and the upfront construction taken care of entirely by the
ProjectBuilder
. There is still the issue of having to run the lifecycle in order to find all the compile source roots and resource directories but I hope to take care of this during the Maven 4.0 release (jvz).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Profile>
activeProfiles
private Artifact
artifact
private ArtifactFilter
artifactFilter
private java.util.Map<java.lang.String,Artifact>
artifactMap
private java.util.Set<Artifact>
artifacts
private java.util.List<Artifact>
attachedArtifacts
private java.io.File
basedir
private org.codehaus.plexus.classworlds.realm.ClassRealm
classRealm
private java.util.List<MavenProject>
collectedProjects
private java.util.List<java.lang.String>
compileSourceRoots
private java.util.Map<java.lang.String,java.lang.Object>
context
private java.util.Set<Artifact>
dependencyArtifacts
static java.lang.String
EMPTY_PROJECT_ARTIFACT_ID
static java.lang.String
EMPTY_PROJECT_GROUP_ID
static java.lang.String
EMPTY_PROJECT_VERSION
private MavenProject
executionProject
private boolean
executionRoot
private java.util.Map<java.lang.String,Artifact>
extensionArtifactMap
private java.util.Set<Artifact>
extensionArtifacts
private org.eclipse.aether.graph.DependencyFilter
extensionDependencyFilter
private java.io.File
file
private java.util.Map<java.lang.String,java.util.List<java.lang.String>>
injectedProfileIds
private java.util.Set<java.lang.String>
lifecyclePhases
private java.util.Map<java.lang.String,Artifact>
managedVersionMap
private Model
model
private java.util.Map<java.lang.String,java.lang.String>
moduleAdjustments
private Model
originalModel
private MavenProject
parent
private Artifact
parentArtifact
private java.io.File
parentFile
private java.util.Map<java.lang.String,Artifact>
pluginArtifactMap
private java.util.List<ArtifactRepository>
pluginArtifactRepositories
private java.util.Set<Artifact>
pluginArtifacts
private ProjectBuildingRequest
projectBuilderConfiguration
private java.util.Map<java.lang.String,MavenProject>
projectReferences
private ArtifactRepository
releaseArtifactRepository
private java.util.List<ArtifactRepository>
remoteArtifactRepositories
private java.util.List<org.eclipse.aether.repository.RemoteRepository>
remotePluginRepositories
private java.util.List<org.eclipse.aether.repository.RemoteRepository>
remoteProjectRepositories
private java.util.Map<java.lang.String,Artifact>
reportArtifactMap
private java.util.Set<Artifact>
reportArtifacts
private java.util.Set<Artifact>
resolvedArtifacts
private java.util.List<java.lang.String>
scriptSourceRoots
private ArtifactRepository
snapshotArtifactRepository
private java.util.List<java.lang.String>
testCompileSourceRoots
-
Constructor Summary
Constructors Constructor Description MavenProject()
MavenProject(Model model)
MavenProject(MavenProject project)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
addArtifactPath(Artifact artifact, java.util.List<java.lang.String> classpath)
void
addAttachedArtifact(Artifact artifact)
Add or replace an artifact.void
addCompileSourceRoot(java.lang.String path)
void
addContributor(Contributor contributor)
void
addDeveloper(Developer developer)
void
addLicense(License license)
void
addLifecyclePhase(java.lang.String lifecyclePhase)
Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API.void
addMailingList(MailingList mailingList)
private void
addPath(java.util.List<java.lang.String> paths, java.lang.String path)
void
addProjectReference(MavenProject project)
void
addResource(Resource resource)
void
addScriptSourceRoot(java.lang.String path)
Deprecated.void
addTestCompileSourceRoot(java.lang.String path)
void
addTestResource(Resource testResource)
void
attachArtifact(java.lang.String type, java.lang.String classifier, java.io.File file)
Deprecated.Use MavenProjectHelper.attachArtifact(..) instead.MavenProject
clone()
java.util.Set<Artifact>
createArtifacts(ArtifactFactory artifactFactory, java.lang.String inheritedScope, ArtifactFilter filter)
Deprecated.private void
deepCopy(MavenProject project)
private static <T> boolean
eq(T s1, T s2)
boolean
equals(java.lang.Object other)
java.util.List<Profile>
getActiveProfiles()
Artifact
getArtifact()
java.lang.String
getArtifactId()
java.util.Map<java.lang.String,Artifact>
getArtifactMap()
java.util.Set<Artifact>
getArtifacts()
All dependencies that this project has, including transitive ones.java.util.List<Artifact>
getAttachedArtifacts()
java.io.File
getBasedir()
Build
getBuild()
java.util.List<Extension>
getBuildExtensions()
java.util.List<Plugin>
getBuildPlugins()
CiManagement
getCiManagement()
org.codehaus.plexus.classworlds.realm.ClassRealm
getClassRealm()
Gets the project's class realm.java.util.List<MavenProject>
getCollectedProjects()
java.util.List<Artifact>
getCompileArtifacts()
Deprecated.java.util.List<java.lang.String>
getCompileClasspathElements()
java.util.List<Dependency>
getCompileDependencies()
Deprecated.java.util.List<java.lang.String>
getCompileSourceRoots()
java.lang.Object
getContextValue(java.lang.String key)
Returns context value of this project associated with the given key or null if this project has no such value.java.util.List<Contributor>
getContributors()
java.lang.String
getDefaultGoal()
java.util.List<Dependency>
getDependencies()
java.util.Set<Artifact>
getDependencyArtifacts()
Deprecated.DependencyManagement
getDependencyManagement()
java.lang.String
getDescription()
java.util.List<Developer>
getDevelopers()
DistributionManagement
getDistributionManagement()
ArtifactRepository
getDistributionManagementArtifactRepository()
MavenProject
getExecutionProject()
java.util.Map<java.lang.String,Artifact>
getExtensionArtifactMap()
Deprecated.java.util.Set<Artifact>
getExtensionArtifacts()
Deprecated.org.eclipse.aether.graph.DependencyFilter
getExtensionDependencyFilter()
Gets the dependency filter used to exclude shared extension artifacts from plugin realms.java.io.File
getFile()
java.util.List<java.lang.String>
getFilters()
org.codehaus.plexus.util.xml.Xpp3Dom
getGoalConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String executionId, java.lang.String goalId)
java.lang.String
getGroupId()
java.lang.String
getId()
java.lang.String
getInceptionYear()
java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getInjectedProfileIds()
Gets the identifiers of all profiles that contributed to this project's effective model.IssueManagement
getIssueManagement()
java.util.List<License>
getLicenses()
java.util.List<MailingList>
getMailingLists()
java.util.Map<java.lang.String,Artifact>
getManagedVersionMap()
Model
getModel()
private Build
getModelBuild()
java.lang.String
getModelVersion()
java.lang.String
getModulePathAdjustment(MavenProject moduleProject)
Deprecated.java.util.List<java.lang.String>
getModules()
java.lang.String
getName()
Organization
getOrganization()
Model
getOriginalModel()
java.lang.String
getPackaging()
MavenProject
getParent()
Returns the project corresponding to a declared parent.Artifact
getParentArtifact()
java.io.File
getParentFile()
Plugin
getPlugin(java.lang.String pluginKey)
java.util.Map<java.lang.String,Artifact>
getPluginArtifactMap()
java.util.List<ArtifactRepository>
getPluginArtifactRepositories()
java.util.Set<Artifact>
getPluginArtifacts()
PluginManagement
getPluginManagement()
java.util.List<Repository>
getPluginRepositories()
Prerequisites
getPrerequisites()
ProjectBuildingRequest
getProjectBuildingRequest()
Deprecated.private static java.lang.String
getProjectReferenceId(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
java.util.Map<java.lang.String,MavenProject>
getProjectReferences()
java.util.Properties
getProperties()
protected ArtifactRepository
getReleaseArtifactRepository()
java.util.List<ArtifactRepository>
getRemoteArtifactRepositories()
java.util.List<org.eclipse.aether.repository.RemoteRepository>
getRemotePluginRepositories()
java.util.List<org.eclipse.aether.repository.RemoteRepository>
getRemoteProjectRepositories()
java.util.Map<java.lang.String,Artifact>
getReportArtifactMap()
Deprecated.java.util.Set<Artifact>
getReportArtifacts()
Deprecated.org.codehaus.plexus.util.xml.Xpp3Dom
getReportConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String reportSetId)
Deprecated.Reporting
getReporting()
Deprecated.java.util.List<ReportPlugin>
getReportPlugins()
Deprecated.java.util.List<Repository>
getRepositories()
java.util.List<Resource>
getResources()
java.util.List<Artifact>
getRuntimeArtifacts()
Deprecated.java.util.List<java.lang.String>
getRuntimeClasspathElements()
java.util.List<Dependency>
getRuntimeDependencies()
Deprecated.Scm
getScm()
java.util.List<java.lang.String>
getScriptSourceRoots()
Deprecated.protected ArtifactRepository
getSnapshotArtifactRepository()
java.util.List<Artifact>
getSystemArtifacts()
Deprecated.java.util.List<java.lang.String>
getSystemClasspathElements()
Deprecated.java.util.List<Dependency>
getSystemDependencies()
Deprecated.java.util.List<Artifact>
getTestArtifacts()
Deprecated.java.util.List<java.lang.String>
getTestClasspathElements()
java.util.List<java.lang.String>
getTestCompileSourceRoots()
java.util.List<Dependency>
getTestDependencies()
Deprecated.java.util.List<Resource>
getTestResources()
java.lang.String
getUrl()
java.lang.String
getVersion()
int
hashCode()
boolean
hasLifecyclePhase(java.lang.String phase)
Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API.boolean
hasParent()
boolean
isExecutionRoot()
Artifact
replaceWithActiveArtifact(Artifact pluginArtifact)
Deprecated.void
setActiveProfiles(java.util.List<Profile> activeProfiles)
void
setArtifact(Artifact artifact)
void
setArtifactFilter(ArtifactFilter artifactFilter)
Sets the scope filter to select the artifacts being exposed to the currently executed mojo.void
setArtifactId(java.lang.String artifactId)
void
setArtifacts(java.util.Set<Artifact> artifacts)
protected void
setAttachedArtifacts(java.util.List<Artifact> attachedArtifacts)
void
setBuild(Build build)
void
setCiManagement(CiManagement ciManagement)
void
setClassRealm(org.codehaus.plexus.classworlds.realm.ClassRealm classRealm)
Sets the project's class realm.void
setCollectedProjects(java.util.List<MavenProject> collectedProjects)
protected void
setCompileSourceRoots(java.util.List<java.lang.String> compileSourceRoots)
void
setContextValue(java.lang.String key, java.lang.Object value)
Sets the value of the context value of this project identified by the given key.void
setContributors(java.util.List<Contributor> contributors)
void
setDependencies(java.util.List<Dependency> dependencies)
void
setDependencyArtifacts(java.util.Set<Artifact> dependencyArtifacts)
Deprecated.void
setDescription(java.lang.String description)
void
setDevelopers(java.util.List<Developer> developers)
void
setDistributionManagement(DistributionManagement distributionManagement)
void
setExecutionProject(MavenProject executionProject)
void
setExecutionRoot(boolean executionRoot)
void
setExtensionArtifacts(java.util.Set<Artifact> extensionArtifacts)
Deprecated.void
setExtensionDependencyFilter(org.eclipse.aether.graph.DependencyFilter extensionDependencyFilter)
Sets the artifact filter used to exclude shared extension artifacts from plugin realms.void
setFile(java.io.File file)
void
setGroupId(java.lang.String groupId)
void
setInceptionYear(java.lang.String inceptionYear)
void
setInjectedProfileIds(java.lang.String source, java.util.List<java.lang.String> injectedProfileIds)
void
setIssueManagement(IssueManagement issueManagement)
void
setLicenses(java.util.List<License> licenses)
void
setMailingLists(java.util.List<MailingList> mailingLists)
void
setManagedVersionMap(java.util.Map<java.lang.String,Artifact> map)
void
setModel(Model model)
void
setModelVersion(java.lang.String pomVersion)
void
setName(java.lang.String name)
void
setOrganization(Organization organization)
void
setOriginalModel(Model originalModel)
void
setPackaging(java.lang.String packaging)
void
setParent(MavenProject parent)
void
setParentArtifact(Artifact parentArtifact)
void
setParentFile(java.io.File parentFile)
void
setPluginArtifactRepositories(java.util.List<ArtifactRepository> pluginArtifactRepositories)
void
setPluginArtifacts(java.util.Set<Artifact> pluginArtifacts)
void
setPomFile(java.io.File file)
Sets projectfile
without changing projectbasedir
.void
setProjectBuildingRequest(ProjectBuildingRequest projectBuildingRequest)
Deprecated.void
setReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository)
void
setRemoteArtifactRepositories(java.util.List<ArtifactRepository> remoteArtifactRepositories)
void
setReportArtifacts(java.util.Set<Artifact> reportArtifacts)
Deprecated.void
setReporting(Reporting reporting)
Deprecated.void
setResolvedArtifacts(java.util.Set<Artifact> artifacts)
Sets the transitive dependency artifacts that have been resolved/collected for this project.void
setScm(Scm scm)
protected void
setScriptSourceRoots(java.util.List<java.lang.String> scriptSourceRoots)
Deprecated.void
setSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository)
protected void
setTestCompileSourceRoots(java.util.List<java.lang.String> testCompileSourceRoots)
void
setUrl(java.lang.String url)
void
setVersion(java.lang.String version)
java.lang.String
toString()
Default toStringvoid
writeModel(java.io.Writer writer)
Deprecated.UseModelWriter
.void
writeOriginalModel(java.io.Writer writer)
Deprecated.UseModelWriter
.
-
-
-
Field Detail
-
EMPTY_PROJECT_GROUP_ID
public static final java.lang.String EMPTY_PROJECT_GROUP_ID
- See Also:
- Constant Field Values
-
EMPTY_PROJECT_ARTIFACT_ID
public static final java.lang.String EMPTY_PROJECT_ARTIFACT_ID
- See Also:
- Constant Field Values
-
EMPTY_PROJECT_VERSION
public static final java.lang.String EMPTY_PROJECT_VERSION
- See Also:
- Constant Field Values
-
model
private Model model
-
parent
private MavenProject parent
-
file
private java.io.File file
-
basedir
private java.io.File basedir
-
resolvedArtifacts
private java.util.Set<Artifact> resolvedArtifacts
-
artifactFilter
private ArtifactFilter artifactFilter
-
artifacts
private java.util.Set<Artifact> artifacts
-
parentArtifact
private Artifact parentArtifact
-
pluginArtifacts
private java.util.Set<Artifact> pluginArtifacts
-
remoteArtifactRepositories
private java.util.List<ArtifactRepository> remoteArtifactRepositories
-
pluginArtifactRepositories
private java.util.List<ArtifactRepository> pluginArtifactRepositories
-
remoteProjectRepositories
private java.util.List<org.eclipse.aether.repository.RemoteRepository> remoteProjectRepositories
-
remotePluginRepositories
private java.util.List<org.eclipse.aether.repository.RemoteRepository> remotePluginRepositories
-
attachedArtifacts
private java.util.List<Artifact> attachedArtifacts
-
executionProject
private MavenProject executionProject
-
collectedProjects
private java.util.List<MavenProject> collectedProjects
-
compileSourceRoots
private java.util.List<java.lang.String> compileSourceRoots
-
testCompileSourceRoots
private java.util.List<java.lang.String> testCompileSourceRoots
-
scriptSourceRoots
private java.util.List<java.lang.String> scriptSourceRoots
-
releaseArtifactRepository
private ArtifactRepository releaseArtifactRepository
-
snapshotArtifactRepository
private ArtifactRepository snapshotArtifactRepository
-
activeProfiles
private java.util.List<Profile> activeProfiles
-
injectedProfileIds
private java.util.Map<java.lang.String,java.util.List<java.lang.String>> injectedProfileIds
-
dependencyArtifacts
private java.util.Set<Artifact> dependencyArtifacts
-
artifact
private Artifact artifact
-
artifactMap
private java.util.Map<java.lang.String,Artifact> artifactMap
-
originalModel
private Model originalModel
-
pluginArtifactMap
private java.util.Map<java.lang.String,Artifact> pluginArtifactMap
-
reportArtifacts
private java.util.Set<Artifact> reportArtifacts
-
reportArtifactMap
private java.util.Map<java.lang.String,Artifact> reportArtifactMap
-
extensionArtifacts
private java.util.Set<Artifact> extensionArtifacts
-
extensionArtifactMap
private java.util.Map<java.lang.String,Artifact> extensionArtifactMap
-
managedVersionMap
private java.util.Map<java.lang.String,Artifact> managedVersionMap
-
projectReferences
private java.util.Map<java.lang.String,MavenProject> projectReferences
-
executionRoot
private boolean executionRoot
-
parentFile
private java.io.File parentFile
-
context
private java.util.Map<java.lang.String,java.lang.Object> context
-
classRealm
private org.codehaus.plexus.classworlds.realm.ClassRealm classRealm
-
extensionDependencyFilter
private org.eclipse.aether.graph.DependencyFilter extensionDependencyFilter
-
lifecyclePhases
private final java.util.Set<java.lang.String> lifecyclePhases
-
projectBuilderConfiguration
private ProjectBuildingRequest projectBuilderConfiguration
-
moduleAdjustments
private java.util.Map<java.lang.String,java.lang.String> moduleAdjustments
-
-
Constructor Detail
-
MavenProject
public MavenProject()
-
MavenProject
public MavenProject(Model model)
-
MavenProject
public MavenProject(MavenProject project)
-
-
Method Detail
-
getParentFile
public java.io.File getParentFile()
-
setParentFile
public void setParentFile(java.io.File parentFile)
-
getArtifact
public Artifact getArtifact()
-
setArtifact
public void setArtifact(Artifact artifact)
-
getModel
public Model getModel()
-
getParent
public MavenProject getParent()
Returns the project corresponding to a declared parent.- Returns:
- the parent, or null if no parent is declared or there was an error building it
-
setParent
public void setParent(MavenProject parent)
-
hasParent
public boolean hasParent()
-
getFile
public java.io.File getFile()
-
setFile
public void setFile(java.io.File file)
-
setPomFile
public void setPomFile(java.io.File file)
Sets projectfile
without changing projectbasedir
.- Since:
- 3.2.4
-
getBasedir
public java.io.File getBasedir()
-
setDependencies
public void setDependencies(java.util.List<Dependency> dependencies)
-
getDependencies
public java.util.List<Dependency> getDependencies()
-
getDependencyManagement
public DependencyManagement getDependencyManagement()
-
addPath
private void addPath(java.util.List<java.lang.String> paths, java.lang.String path)
-
addCompileSourceRoot
public void addCompileSourceRoot(java.lang.String path)
-
addTestCompileSourceRoot
public void addTestCompileSourceRoot(java.lang.String path)
-
getCompileSourceRoots
public java.util.List<java.lang.String> getCompileSourceRoots()
-
getTestCompileSourceRoots
public java.util.List<java.lang.String> getTestCompileSourceRoots()
-
getCompileClasspathElements
public java.util.List<java.lang.String> getCompileClasspathElements() throws DependencyResolutionRequiredException
-
getTestClasspathElements
public java.util.List<java.lang.String> getTestClasspathElements() throws DependencyResolutionRequiredException
-
getRuntimeClasspathElements
public java.util.List<java.lang.String> getRuntimeClasspathElements() throws DependencyResolutionRequiredException
-
setModelVersion
public void setModelVersion(java.lang.String pomVersion)
-
getModelVersion
public java.lang.String getModelVersion()
-
getId
public java.lang.String getId()
-
setGroupId
public void setGroupId(java.lang.String groupId)
-
getGroupId
public java.lang.String getGroupId()
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
-
getArtifactId
public java.lang.String getArtifactId()
-
setName
public void setName(java.lang.String name)
-
getName
public java.lang.String getName()
-
setVersion
public void setVersion(java.lang.String version)
-
getVersion
public java.lang.String getVersion()
-
getPackaging
public java.lang.String getPackaging()
-
setPackaging
public void setPackaging(java.lang.String packaging)
-
setInceptionYear
public void setInceptionYear(java.lang.String inceptionYear)
-
getInceptionYear
public java.lang.String getInceptionYear()
-
setUrl
public void setUrl(java.lang.String url)
-
getUrl
public java.lang.String getUrl()
-
getPrerequisites
public Prerequisites getPrerequisites()
-
setIssueManagement
public void setIssueManagement(IssueManagement issueManagement)
-
getCiManagement
public CiManagement getCiManagement()
-
setCiManagement
public void setCiManagement(CiManagement ciManagement)
-
getIssueManagement
public IssueManagement getIssueManagement()
-
setDistributionManagement
public void setDistributionManagement(DistributionManagement distributionManagement)
-
getDistributionManagement
public DistributionManagement getDistributionManagement()
-
setDescription
public void setDescription(java.lang.String description)
-
getDescription
public java.lang.String getDescription()
-
setOrganization
public void setOrganization(Organization organization)
-
getOrganization
public Organization getOrganization()
-
setScm
public void setScm(Scm scm)
-
getScm
public Scm getScm()
-
setMailingLists
public void setMailingLists(java.util.List<MailingList> mailingLists)
-
getMailingLists
public java.util.List<MailingList> getMailingLists()
-
addMailingList
public void addMailingList(MailingList mailingList)
-
setDevelopers
public void setDevelopers(java.util.List<Developer> developers)
-
getDevelopers
public java.util.List<Developer> getDevelopers()
-
addDeveloper
public void addDeveloper(Developer developer)
-
setContributors
public void setContributors(java.util.List<Contributor> contributors)
-
getContributors
public java.util.List<Contributor> getContributors()
-
addContributor
public void addContributor(Contributor contributor)
-
setBuild
public void setBuild(Build build)
-
getBuild
public Build getBuild()
-
getResources
public java.util.List<Resource> getResources()
-
getTestResources
public java.util.List<Resource> getTestResources()
-
addResource
public void addResource(Resource resource)
-
addTestResource
public void addTestResource(Resource testResource)
-
setLicenses
public void setLicenses(java.util.List<License> licenses)
-
getLicenses
public java.util.List<License> getLicenses()
-
addLicense
public void addLicense(License license)
-
setArtifacts
public void setArtifacts(java.util.Set<Artifact> artifacts)
-
getArtifacts
public java.util.Set<Artifact> getArtifacts()
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.- Returns:
Set
<Artifact
>- See Also:
to get only direct dependencies
-
getArtifactMap
public java.util.Map<java.lang.String,Artifact> getArtifactMap()
-
setPluginArtifacts
public void setPluginArtifacts(java.util.Set<Artifact> pluginArtifacts)
-
getPluginArtifacts
public java.util.Set<Artifact> getPluginArtifacts()
-
getPluginArtifactMap
public java.util.Map<java.lang.String,Artifact> getPluginArtifactMap()
-
setParentArtifact
public void setParentArtifact(Artifact parentArtifact)
-
getParentArtifact
public Artifact getParentArtifact()
-
getRepositories
public java.util.List<Repository> getRepositories()
-
getBuildPlugins
public java.util.List<Plugin> getBuildPlugins()
-
getModules
public java.util.List<java.lang.String> getModules()
-
getPluginManagement
public PluginManagement getPluginManagement()
-
getModelBuild
private Build getModelBuild()
-
setRemoteArtifactRepositories
public void setRemoteArtifactRepositories(java.util.List<ArtifactRepository> remoteArtifactRepositories)
-
getRemoteArtifactRepositories
public java.util.List<ArtifactRepository> getRemoteArtifactRepositories()
-
setPluginArtifactRepositories
public void setPluginArtifactRepositories(java.util.List<ArtifactRepository> pluginArtifactRepositories)
-
getPluginArtifactRepositories
public java.util.List<ArtifactRepository> getPluginArtifactRepositories()
- Returns:
- a list of ArtifactRepository objects constructed from the Repository objects returned by getPluginRepositories.
-
getDistributionManagementArtifactRepository
public ArtifactRepository getDistributionManagementArtifactRepository()
-
getPluginRepositories
public java.util.List<Repository> getPluginRepositories()
-
getRemoteProjectRepositories
public java.util.List<org.eclipse.aether.repository.RemoteRepository> getRemoteProjectRepositories()
-
getRemotePluginRepositories
public java.util.List<org.eclipse.aether.repository.RemoteRepository> getRemotePluginRepositories()
-
setActiveProfiles
public void setActiveProfiles(java.util.List<Profile> activeProfiles)
-
getActiveProfiles
public java.util.List<Profile> getActiveProfiles()
-
setInjectedProfileIds
public void setInjectedProfileIds(java.lang.String source, java.util.List<java.lang.String> injectedProfileIds)
-
getInjectedProfileIds
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getInjectedProfileIds()
Gets the identifiers of all profiles that contributed to this project's effective model. This includes active profiles from the project's POM and all its parent POMs as well as from external sources like thesettings.xml
. The profile identifiers are grouped by the identifier of their source, e.g.<groupId>:<artifactId>:<version>
for a POM profile orexternal
for profiles from thesettings.xml
.- Returns:
- The identifiers of all injected profiles, indexed by the source from which the profiles originated, never
null
.
-
addAttachedArtifact
public void addAttachedArtifact(Artifact artifact) throws DuplicateArtifactAttachmentException
Add or replace an artifact. This method is now deprecated. Use the @{MavenProjectHelper} to attach artifacts to a project. In spite of the 'throws' declaration on this API, this method has never thrown an exception since Maven 3.0.x. Historically, it logged and ignored a second addition of the same g/a/v/c/t. Now it replaces the file for the artifact, so that plugins (e.g. shade) can change the pathname of the file for a particular set of coordinates.- Parameters:
artifact
- the artifact to add or replace.- Throws:
DuplicateArtifactAttachmentException
-
getAttachedArtifacts
public java.util.List<Artifact> getAttachedArtifacts()
-
getGoalConfiguration
public org.codehaus.plexus.util.xml.Xpp3Dom getGoalConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String executionId, java.lang.String goalId)
-
getExecutionProject
public MavenProject getExecutionProject()
-
setExecutionProject
public void setExecutionProject(MavenProject executionProject)
-
getCollectedProjects
public java.util.List<MavenProject> getCollectedProjects()
-
setCollectedProjects
public void setCollectedProjects(java.util.List<MavenProject> collectedProjects)
-
getDependencyArtifacts
@Deprecated public java.util.Set<Artifact> getDependencyArtifacts()
Deprecated.Direct dependencies that this project has.- Returns:
Set
<Artifact
>- See Also:
to get all transitive dependencies
-
setDependencyArtifacts
@Deprecated public void setDependencyArtifacts(java.util.Set<Artifact> dependencyArtifacts)
Deprecated.
-
setReleaseArtifactRepository
public void setReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository)
-
setSnapshotArtifactRepository
public void setSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository)
-
setOriginalModel
public void setOriginalModel(Model originalModel)
-
getOriginalModel
public Model getOriginalModel()
-
setManagedVersionMap
public void setManagedVersionMap(java.util.Map<java.lang.String,Artifact> map)
-
getManagedVersionMap
public java.util.Map<java.lang.String,Artifact> getManagedVersionMap()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
eq
private static <T> boolean eq(T s1, T s2)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getBuildExtensions
public java.util.List<Extension> getBuildExtensions()
-
addProjectReference
public void addProjectReference(MavenProject project)
-
getProperties
public java.util.Properties getProperties()
-
getFilters
public java.util.List<java.lang.String> getFilters()
-
getProjectReferences
public java.util.Map<java.lang.String,MavenProject> getProjectReferences()
-
isExecutionRoot
public boolean isExecutionRoot()
-
setExecutionRoot
public void setExecutionRoot(boolean executionRoot)
-
getDefaultGoal
public java.lang.String getDefaultGoal()
-
getPlugin
public Plugin getPlugin(java.lang.String pluginKey)
-
toString
public java.lang.String toString()
Default toString- Overrides:
toString
in classjava.lang.Object
-
clone
public MavenProject clone()
- Overrides:
clone
in classjava.lang.Object
- Since:
- 2.0.9
-
setModel
public void setModel(Model model)
-
setAttachedArtifacts
protected void setAttachedArtifacts(java.util.List<Artifact> attachedArtifacts)
-
setCompileSourceRoots
protected void setCompileSourceRoots(java.util.List<java.lang.String> compileSourceRoots)
-
setTestCompileSourceRoots
protected void setTestCompileSourceRoots(java.util.List<java.lang.String> testCompileSourceRoots)
-
getReleaseArtifactRepository
protected ArtifactRepository getReleaseArtifactRepository()
-
getSnapshotArtifactRepository
protected ArtifactRepository getSnapshotArtifactRepository()
-
deepCopy
private void deepCopy(MavenProject project)
-
addArtifactPath
private void addArtifactPath(Artifact artifact, java.util.List<java.lang.String> classpath)
-
getProjectReferenceId
private static java.lang.String getProjectReferenceId(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
-
setContextValue
public void setContextValue(java.lang.String key, java.lang.Object value)
Sets the value of the context value of this project identified by the given key. If the supplied value isnull
, the context value is removed from this project. Context values are intended to allow core extensions to associate derived state with project instances.
-
getContextValue
public java.lang.Object getContextValue(java.lang.String key)
Returns context value of this project associated with the given key or null if this project has no such value.
-
setClassRealm
public void setClassRealm(org.codehaus.plexus.classworlds.realm.ClassRealm classRealm)
Sets the project's class realm. Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Parameters:
classRealm
- The class realm hosting the build extensions of this project, may benull
.
-
getClassRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getClassRealm()
Gets the project's class realm. This class realm hosts the build extensions of the project. Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Returns:
- The project's class realm or
null
.
-
setExtensionDependencyFilter
public void setExtensionDependencyFilter(org.eclipse.aether.graph.DependencyFilter extensionDependencyFilter)
Sets the artifact filter used to exclude shared extension artifacts from plugin realms. Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Parameters:
extensionDependencyFilter
- The dependency filter to apply to plugins, may benull
.
-
getExtensionDependencyFilter
public org.eclipse.aether.graph.DependencyFilter getExtensionDependencyFilter()
Gets the dependency filter used to exclude shared extension artifacts from plugin realms. Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Returns:
- The dependency filter or
null
.
-
setResolvedArtifacts
public void setResolvedArtifacts(java.util.Set<Artifact> artifacts)
Sets the transitive dependency artifacts that have been resolved/collected for this project. Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Parameters:
artifacts
- The set of artifacts, may benull
.
-
setArtifactFilter
public void setArtifactFilter(ArtifactFilter artifactFilter)
Sets the scope filter to select the artifacts being exposed to the currently executed mojo. Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Parameters:
artifactFilter
- The artifact filter, may benull
to exclude all artifacts.
-
hasLifecyclePhase
public boolean hasLifecyclePhase(java.lang.String phase)
Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Parameters:
phase
- The phase to check for, must not benull
.- Returns:
true
if the phase has been seen.
-
addLifecyclePhase
public void addLifecyclePhase(java.lang.String lifecyclePhase)
Warning: This is an internal utility method that is only public for technical reasons, it is not part of the public API. In particular, this method can be changed or deleted without prior notice and must not be used by plugins.- Parameters:
lifecyclePhase
- The lifecycle phase to add, must not benull
.
-
getModulePathAdjustment
@Deprecated public java.lang.String getModulePathAdjustment(MavenProject moduleProject) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
createArtifacts
@Deprecated public java.util.Set<Artifact> createArtifacts(ArtifactFactory artifactFactory, java.lang.String inheritedScope, ArtifactFilter filter) throws InvalidDependencyVersionException
Deprecated.
-
setScriptSourceRoots
@Deprecated protected void setScriptSourceRoots(java.util.List<java.lang.String> scriptSourceRoots)
Deprecated.
-
addScriptSourceRoot
@Deprecated public void addScriptSourceRoot(java.lang.String path)
Deprecated.
-
getScriptSourceRoots
@Deprecated public java.util.List<java.lang.String> getScriptSourceRoots()
Deprecated.
-
getCompileArtifacts
@Deprecated public java.util.List<Artifact> getCompileArtifacts()
Deprecated.
-
getCompileDependencies
@Deprecated public java.util.List<Dependency> getCompileDependencies()
Deprecated.
-
getTestArtifacts
@Deprecated public java.util.List<Artifact> getTestArtifacts()
Deprecated.
-
getTestDependencies
@Deprecated public java.util.List<Dependency> getTestDependencies()
Deprecated.
-
getRuntimeDependencies
@Deprecated public java.util.List<Dependency> getRuntimeDependencies()
Deprecated.
-
getRuntimeArtifacts
@Deprecated public java.util.List<Artifact> getRuntimeArtifacts()
Deprecated.
-
getSystemClasspathElements
@Deprecated public java.util.List<java.lang.String> getSystemClasspathElements() throws DependencyResolutionRequiredException
Deprecated.
-
getSystemArtifacts
@Deprecated public java.util.List<Artifact> getSystemArtifacts()
Deprecated.
-
getSystemDependencies
@Deprecated public java.util.List<Dependency> getSystemDependencies()
Deprecated.
-
setReporting
@Deprecated public void setReporting(Reporting reporting)
Deprecated.
-
getReporting
@Deprecated public Reporting getReporting()
Deprecated.
-
setReportArtifacts
@Deprecated public void setReportArtifacts(java.util.Set<Artifact> reportArtifacts)
Deprecated.
-
getReportArtifacts
@Deprecated public java.util.Set<Artifact> getReportArtifacts()
Deprecated.
-
getReportArtifactMap
@Deprecated public java.util.Map<java.lang.String,Artifact> getReportArtifactMap()
Deprecated.
-
setExtensionArtifacts
@Deprecated public void setExtensionArtifacts(java.util.Set<Artifact> extensionArtifacts)
Deprecated.
-
getExtensionArtifacts
@Deprecated public java.util.Set<Artifact> getExtensionArtifacts()
Deprecated.
-
getExtensionArtifactMap
@Deprecated public java.util.Map<java.lang.String,Artifact> getExtensionArtifactMap()
Deprecated.
-
getReportPlugins
@Deprecated public java.util.List<ReportPlugin> getReportPlugins()
Deprecated.
-
getReportConfiguration
@Deprecated public org.codehaus.plexus.util.xml.Xpp3Dom getReportConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String reportSetId)
Deprecated.
-
attachArtifact
@Deprecated public void attachArtifact(java.lang.String type, java.lang.String classifier, java.io.File file)
Deprecated.Use MavenProjectHelper.attachArtifact(..) instead.
-
writeModel
@Deprecated public void writeModel(java.io.Writer writer) throws java.io.IOException
Deprecated.UseModelWriter
.- Throws:
java.io.IOException
-
writeOriginalModel
@Deprecated public void writeOriginalModel(java.io.Writer writer) throws java.io.IOException
Deprecated.UseModelWriter
.- Throws:
java.io.IOException
-
replaceWithActiveArtifact
@Deprecated public Artifact replaceWithActiveArtifact(Artifact pluginArtifact)
Deprecated.
-
getProjectBuildingRequest
@Deprecated public ProjectBuildingRequest getProjectBuildingRequest()
Deprecated.Gets the project building request from which this project instance was created. Warning: This is an utility method that is meant to assist integrators of Maven, it must not be used by Maven plugins.- Returns:
- The project building request or
null
. - Since:
- 2.1
-
setProjectBuildingRequest
@Deprecated public void setProjectBuildingRequest(ProjectBuildingRequest projectBuildingRequest)
Deprecated.Sets the project building request from which this project instance was created. Warning: This is an utility method that is meant to assist integrators of Maven, it must not be used by Maven plugins.- Parameters:
projectBuildingRequest
- The project building request, may benull
.- Since:
- 2.1
-
-