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.CloneableThe 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>activeProfilesprivate Artifactartifactprivate ArtifactFilterartifactFilterprivate java.util.Map<java.lang.String,Artifact>artifactMapprivate java.util.Set<Artifact>artifactsprivate java.util.List<Artifact>attachedArtifactsprivate java.io.Filebasedirprivate org.codehaus.plexus.classworlds.realm.ClassRealmclassRealmprivate java.util.List<MavenProject>collectedProjectsprivate java.util.List<java.lang.String>compileSourceRootsprivate java.util.Map<java.lang.String,java.lang.Object>contextprivate java.util.Set<Artifact>dependencyArtifactsstatic java.lang.StringEMPTY_PROJECT_ARTIFACT_IDstatic java.lang.StringEMPTY_PROJECT_GROUP_IDstatic java.lang.StringEMPTY_PROJECT_VERSIONprivate MavenProjectexecutionProjectprivate booleanexecutionRootprivate java.util.Map<java.lang.String,Artifact>extensionArtifactMapprivate java.util.Set<Artifact>extensionArtifactsprivate org.eclipse.aether.graph.DependencyFilterextensionDependencyFilterprivate java.io.Filefileprivate java.util.Map<java.lang.String,java.util.List<java.lang.String>>injectedProfileIdsprivate java.util.Set<java.lang.String>lifecyclePhasesprivate java.util.Map<java.lang.String,Artifact>managedVersionMapprivate Modelmodelprivate java.util.Map<java.lang.String,java.lang.String>moduleAdjustmentsprivate ModeloriginalModelprivate MavenProjectparentprivate ArtifactparentArtifactprivate java.io.FileparentFileprivate java.util.Map<java.lang.String,Artifact>pluginArtifactMapprivate java.util.List<ArtifactRepository>pluginArtifactRepositoriesprivate java.util.Set<Artifact>pluginArtifactsprivate ProjectBuildingRequestprojectBuilderConfigurationprivate java.util.Map<java.lang.String,MavenProject>projectReferencesprivate ArtifactRepositoryreleaseArtifactRepositoryprivate java.util.List<ArtifactRepository>remoteArtifactRepositoriesprivate java.util.List<org.eclipse.aether.repository.RemoteRepository>remotePluginRepositoriesprivate java.util.List<org.eclipse.aether.repository.RemoteRepository>remoteProjectRepositoriesprivate java.util.Map<java.lang.String,Artifact>reportArtifactMapprivate java.util.Set<Artifact>reportArtifactsprivate java.util.Set<Artifact>resolvedArtifactsprivate java.util.List<java.lang.String>scriptSourceRootsprivate ArtifactRepositorysnapshotArtifactRepositoryprivate 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 voidaddArtifactPath(Artifact artifact, java.util.List<java.lang.String> classpath)voidaddAttachedArtifact(Artifact artifact)Add or replace an artifact.voidaddCompileSourceRoot(java.lang.String path)voidaddContributor(Contributor contributor)voidaddDeveloper(Developer developer)voidaddLicense(License license)voidaddLifecyclePhase(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.voidaddMailingList(MailingList mailingList)private voidaddPath(java.util.List<java.lang.String> paths, java.lang.String path)voidaddProjectReference(MavenProject project)voidaddResource(Resource resource)voidaddScriptSourceRoot(java.lang.String path)Deprecated.voidaddTestCompileSourceRoot(java.lang.String path)voidaddTestResource(Resource testResource)voidattachArtifact(java.lang.String type, java.lang.String classifier, java.io.File file)Deprecated.Use MavenProjectHelper.attachArtifact(..) instead.MavenProjectclone()java.util.Set<Artifact>createArtifacts(ArtifactFactory artifactFactory, java.lang.String inheritedScope, ArtifactFilter filter)Deprecated.private voiddeepCopy(MavenProject project)private static <T> booleaneq(T s1, T s2)booleanequals(java.lang.Object other)java.util.List<Profile>getActiveProfiles()ArtifactgetArtifact()java.lang.StringgetArtifactId()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.FilegetBasedir()BuildgetBuild()java.util.List<Extension>getBuildExtensions()java.util.List<Plugin>getBuildPlugins()CiManagementgetCiManagement()org.codehaus.plexus.classworlds.realm.ClassRealmgetClassRealm()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.ObjectgetContextValue(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.StringgetDefaultGoal()java.util.List<Dependency>getDependencies()java.util.Set<Artifact>getDependencyArtifacts()Deprecated.DependencyManagementgetDependencyManagement()java.lang.StringgetDescription()java.util.List<Developer>getDevelopers()DistributionManagementgetDistributionManagement()ArtifactRepositorygetDistributionManagementArtifactRepository()MavenProjectgetExecutionProject()java.util.Map<java.lang.String,Artifact>getExtensionArtifactMap()Deprecated.java.util.Set<Artifact>getExtensionArtifacts()Deprecated.org.eclipse.aether.graph.DependencyFiltergetExtensionDependencyFilter()Gets the dependency filter used to exclude shared extension artifacts from plugin realms.java.io.FilegetFile()java.util.List<java.lang.String>getFilters()org.codehaus.plexus.util.xml.Xpp3DomgetGoalConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String executionId, java.lang.String goalId)java.lang.StringgetGroupId()java.lang.StringgetId()java.lang.StringgetInceptionYear()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.IssueManagementgetIssueManagement()java.util.List<License>getLicenses()java.util.List<MailingList>getMailingLists()java.util.Map<java.lang.String,Artifact>getManagedVersionMap()ModelgetModel()private BuildgetModelBuild()java.lang.StringgetModelVersion()java.lang.StringgetModulePathAdjustment(MavenProject moduleProject)Deprecated.java.util.List<java.lang.String>getModules()java.lang.StringgetName()OrganizationgetOrganization()ModelgetOriginalModel()java.lang.StringgetPackaging()MavenProjectgetParent()Returns the project corresponding to a declared parent.ArtifactgetParentArtifact()java.io.FilegetParentFile()PlugingetPlugin(java.lang.String pluginKey)java.util.Map<java.lang.String,Artifact>getPluginArtifactMap()java.util.List<ArtifactRepository>getPluginArtifactRepositories()java.util.Set<Artifact>getPluginArtifacts()PluginManagementgetPluginManagement()java.util.List<Repository>getPluginRepositories()PrerequisitesgetPrerequisites()ProjectBuildingRequestgetProjectBuildingRequest()Deprecated.private static java.lang.StringgetProjectReferenceId(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)java.util.Map<java.lang.String,MavenProject>getProjectReferences()java.util.PropertiesgetProperties()protected ArtifactRepositorygetReleaseArtifactRepository()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.Xpp3DomgetReportConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String reportSetId)Deprecated.ReportinggetReporting()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.ScmgetScm()java.util.List<java.lang.String>getScriptSourceRoots()Deprecated.protected ArtifactRepositorygetSnapshotArtifactRepository()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.StringgetUrl()java.lang.StringgetVersion()inthashCode()booleanhasLifecyclePhase(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.booleanhasParent()booleanisExecutionRoot()ArtifactreplaceWithActiveArtifact(Artifact pluginArtifact)Deprecated.voidsetActiveProfiles(java.util.List<Profile> activeProfiles)voidsetArtifact(Artifact artifact)voidsetArtifactFilter(ArtifactFilter artifactFilter)Sets the scope filter to select the artifacts being exposed to the currently executed mojo.voidsetArtifactId(java.lang.String artifactId)voidsetArtifacts(java.util.Set<Artifact> artifacts)protected voidsetAttachedArtifacts(java.util.List<Artifact> attachedArtifacts)voidsetBuild(Build build)voidsetCiManagement(CiManagement ciManagement)voidsetClassRealm(org.codehaus.plexus.classworlds.realm.ClassRealm classRealm)Sets the project's class realm.voidsetCollectedProjects(java.util.List<MavenProject> collectedProjects)protected voidsetCompileSourceRoots(java.util.List<java.lang.String> compileSourceRoots)voidsetContextValue(java.lang.String key, java.lang.Object value)Sets the value of the context value of this project identified by the given key.voidsetContributors(java.util.List<Contributor> contributors)voidsetDependencies(java.util.List<Dependency> dependencies)voidsetDependencyArtifacts(java.util.Set<Artifact> dependencyArtifacts)Deprecated.voidsetDescription(java.lang.String description)voidsetDevelopers(java.util.List<Developer> developers)voidsetDistributionManagement(DistributionManagement distributionManagement)voidsetExecutionProject(MavenProject executionProject)voidsetExecutionRoot(boolean executionRoot)voidsetExtensionArtifacts(java.util.Set<Artifact> extensionArtifacts)Deprecated.voidsetExtensionDependencyFilter(org.eclipse.aether.graph.DependencyFilter extensionDependencyFilter)Sets the artifact filter used to exclude shared extension artifacts from plugin realms.voidsetFile(java.io.File file)voidsetGroupId(java.lang.String groupId)voidsetInceptionYear(java.lang.String inceptionYear)voidsetInjectedProfileIds(java.lang.String source, java.util.List<java.lang.String> injectedProfileIds)voidsetIssueManagement(IssueManagement issueManagement)voidsetLicenses(java.util.List<License> licenses)voidsetMailingLists(java.util.List<MailingList> mailingLists)voidsetManagedVersionMap(java.util.Map<java.lang.String,Artifact> map)voidsetModel(Model model)voidsetModelVersion(java.lang.String pomVersion)voidsetName(java.lang.String name)voidsetOrganization(Organization organization)voidsetOriginalModel(Model originalModel)voidsetPackaging(java.lang.String packaging)voidsetParent(MavenProject parent)voidsetParentArtifact(Artifact parentArtifact)voidsetParentFile(java.io.File parentFile)voidsetPluginArtifactRepositories(java.util.List<ArtifactRepository> pluginArtifactRepositories)voidsetPluginArtifacts(java.util.Set<Artifact> pluginArtifacts)voidsetPomFile(java.io.File file)Sets projectfilewithout changing projectbasedir.voidsetProjectBuildingRequest(ProjectBuildingRequest projectBuildingRequest)Deprecated.voidsetReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository)voidsetRemoteArtifactRepositories(java.util.List<ArtifactRepository> remoteArtifactRepositories)voidsetReportArtifacts(java.util.Set<Artifact> reportArtifacts)Deprecated.voidsetReporting(Reporting reporting)Deprecated.voidsetResolvedArtifacts(java.util.Set<Artifact> artifacts)Sets the transitive dependency artifacts that have been resolved/collected for this project.voidsetScm(Scm scm)protected voidsetScriptSourceRoots(java.util.List<java.lang.String> scriptSourceRoots)Deprecated.voidsetSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository)protected voidsetTestCompileSourceRoots(java.util.List<java.lang.String> testCompileSourceRoots)voidsetUrl(java.lang.String url)voidsetVersion(java.lang.String version)java.lang.StringtoString()Default toStringvoidwriteModel(java.io.Writer writer)Deprecated.UseModelWriter.voidwriteOriginalModel(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 projectfilewithout 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 orexternalfor 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:
equalsin classjava.lang.Object
-
eq
private static <T> boolean eq(T s1, T s2)
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
toStringin classjava.lang.Object
-
clone
public MavenProject clone()
- Overrides:
clonein 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 benullto 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:
trueif 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 DependencyResolutionRequiredExceptionDeprecated.
-
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.IOExceptionDeprecated.UseModelWriter.- Throws:
java.io.IOException
-
writeOriginalModel
@Deprecated public void writeOriginalModel(java.io.Writer writer) throws java.io.IOExceptionDeprecated.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
-
-