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 static java.lang.StringEMPTY_PROJECT_ARTIFACT_IDstatic java.lang.StringEMPTY_PROJECT_GROUP_IDstatic java.lang.StringEMPTY_PROJECT_VERSION
-
Constructor Summary
Constructors Constructor Description MavenProject()MavenProject(org.apache.maven.model.Model model)MavenProject(MavenProject project)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAttachedArtifact(org.apache.maven.artifact.Artifact artifact)Deprecated.Please useMavenProjectHelpervoidaddCompileSourceRoot(java.lang.String path)Adds the specified path to the list of compile source roots for this project.voidaddContributor(org.apache.maven.model.Contributor contributor)voidaddDeveloper(org.apache.maven.model.Developer developer)voidaddLicense(org.apache.maven.model.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(org.apache.maven.model.MailingList mailingList)voidaddProjectReference(MavenProject project)voidaddResource(org.apache.maven.model.Resource resource)voidaddScriptSourceRoot(java.lang.String path)Deprecated.voidaddTestCompileSourceRoot(java.lang.String path)Adds the specified path to the list of test compile source roots for this project.voidaddTestResource(org.apache.maven.model.Resource testResource)voidattachArtifact(java.lang.String type, java.lang.String classifier, java.io.File file)Deprecated.Use MavenProjectHelper.attachArtifact(..) instead.MavenProjectclone()java.util.Set<org.apache.maven.artifact.Artifact>createArtifacts(ArtifactFactory artifactFactory, java.lang.String inheritedScope, org.apache.maven.artifact.resolver.filter.ArtifactFilter filter)Deprecated.booleanequals(java.lang.Object other)java.util.List<org.apache.maven.model.Profile>getActiveProfiles()org.apache.maven.artifact.ArtifactgetArtifact()java.lang.StringgetArtifactId()java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact>getArtifactMap()java.util.Set<org.apache.maven.artifact.Artifact>getArtifacts()All dependencies that this project has, including transitive ones.java.util.List<org.apache.maven.artifact.Artifact>getAttachedArtifacts()Returns a mutable list of the attached artifacts to this project.java.io.FilegetBasedir()org.apache.maven.model.BuildgetBuild()java.util.List<org.apache.maven.model.Extension>getBuildExtensions()java.util.List<org.apache.maven.model.Plugin>getBuildPlugins()org.apache.maven.model.CiManagementgetCiManagement()org.codehaus.plexus.classworlds.realm.ClassRealmgetClassRealm()Gets the project's class realm.java.util.List<MavenProject>getCollectedProjects()java.util.List<org.apache.maven.artifact.Artifact>getCompileArtifacts()Deprecated.java.util.List<java.lang.String>getCompileClasspathElements()java.util.List<org.apache.maven.model.Dependency>getCompileDependencies()Deprecated.java.util.List<java.lang.String>getCompileSourceRoots()Gets the list of compile source roots for this project.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<org.apache.maven.model.Contributor>getContributors()java.lang.StringgetDefaultGoal()java.util.List<org.apache.maven.model.Dependency>getDependencies()java.util.Set<org.apache.maven.artifact.Artifact>getDependencyArtifacts()Deprecated.org.apache.maven.model.DependencyManagementgetDependencyManagement()java.lang.StringgetDescription()java.util.List<org.apache.maven.model.Developer>getDevelopers()org.apache.maven.model.DistributionManagementgetDistributionManagement()org.apache.maven.artifact.repository.ArtifactRepositorygetDistributionManagementArtifactRepository()MavenProjectgetExecutionProject()java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact>getExtensionArtifactMap()Deprecated.java.util.Set<org.apache.maven.artifact.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.org.apache.maven.model.IssueManagementgetIssueManagement()java.util.List<org.apache.maven.model.License>getLicenses()java.util.List<org.apache.maven.model.MailingList>getMailingLists()java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact>getManagedVersionMap()org.apache.maven.model.ModelgetModel()java.lang.StringgetModelVersion()java.lang.StringgetModulePathAdjustment(MavenProject moduleProject)Deprecated.java.util.List<java.lang.String>getModules()java.lang.StringgetName()org.apache.maven.model.OrganizationgetOrganization()org.apache.maven.model.ModelgetOriginalModel()java.lang.StringgetPackaging()MavenProjectgetParent()Returns the project corresponding to a declared parent.org.apache.maven.artifact.ArtifactgetParentArtifact()java.io.FilegetParentFile()org.apache.maven.model.PlugingetPlugin(java.lang.String pluginKey)java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact>getPluginArtifactMap()java.util.List<org.apache.maven.artifact.repository.ArtifactRepository>getPluginArtifactRepositories()java.util.Set<org.apache.maven.artifact.Artifact>getPluginArtifacts()org.apache.maven.model.PluginManagementgetPluginManagement()java.util.List<org.apache.maven.model.Repository>getPluginRepositories()org.apache.maven.model.PrerequisitesgetPrerequisites()ProjectBuildingRequestgetProjectBuildingRequest()Deprecated.java.util.Map<java.lang.String,MavenProject>getProjectReferences()java.util.PropertiesgetProperties()protected org.apache.maven.artifact.repository.ArtifactRepositorygetReleaseArtifactRepository()java.util.List<org.apache.maven.artifact.repository.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,org.apache.maven.artifact.Artifact>getReportArtifactMap()Deprecated.java.util.Set<org.apache.maven.artifact.Artifact>getReportArtifacts()Deprecated.org.codehaus.plexus.util.xml.Xpp3DomgetReportConfiguration(java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String reportSetId)Deprecated.org.apache.maven.model.ReportinggetReporting()Deprecated.java.util.List<org.apache.maven.model.ReportPlugin>getReportPlugins()Deprecated.java.util.List<org.apache.maven.model.Repository>getRepositories()java.util.List<org.apache.maven.model.Resource>getResources()java.util.List<org.apache.maven.artifact.Artifact>getRuntimeArtifacts()Deprecated.java.util.List<java.lang.String>getRuntimeClasspathElements()java.util.List<org.apache.maven.model.Dependency>getRuntimeDependencies()Deprecated.org.apache.maven.model.ScmgetScm()java.util.List<java.lang.String>getScriptSourceRoots()Deprecated.protected org.apache.maven.artifact.repository.ArtifactRepositorygetSnapshotArtifactRepository()java.util.List<org.apache.maven.artifact.Artifact>getSystemArtifacts()Deprecated.java.util.List<java.lang.String>getSystemClasspathElements()Deprecated.java.util.List<org.apache.maven.model.Dependency>getSystemDependencies()Deprecated.java.util.List<org.apache.maven.artifact.Artifact>getTestArtifacts()Deprecated.java.util.List<java.lang.String>getTestClasspathElements()java.util.List<java.lang.String>getTestCompileSourceRoots()Gets the list of test compile source roots for this project.java.util.List<org.apache.maven.model.Dependency>getTestDependencies()Deprecated.java.util.List<org.apache.maven.model.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()voidremoveCompileSourceRoot(java.lang.String path)Removes the specified path from the list of compile source roots.voidremoveTestCompileSourceRoot(java.lang.String path)Removes the specified path from the list of test compile source roots.org.apache.maven.artifact.ArtifactreplaceWithActiveArtifact(org.apache.maven.artifact.Artifact pluginArtifact)Deprecated.voidsetActiveProfiles(java.util.List<org.apache.maven.model.Profile> activeProfiles)voidsetArtifact(org.apache.maven.artifact.Artifact artifact)voidsetArtifactFilter(org.apache.maven.artifact.resolver.filter.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<org.apache.maven.artifact.Artifact> artifacts)protected voidsetAttachedArtifacts(java.util.List<org.apache.maven.artifact.Artifact> attachedArtifacts)voidsetBuild(org.apache.maven.model.Build build)voidsetCiManagement(org.apache.maven.model.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<org.apache.maven.model.Contributor> contributors)voidsetDependencies(java.util.List<org.apache.maven.model.Dependency> dependencies)voidsetDependencyArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> dependencyArtifacts)Deprecated.voidsetDescription(java.lang.String description)voidsetDevelopers(java.util.List<org.apache.maven.model.Developer> developers)voidsetDistributionManagement(org.apache.maven.model.DistributionManagement distributionManagement)voidsetExecutionProject(MavenProject executionProject)voidsetExecutionRoot(boolean executionRoot)voidsetExtensionArtifacts(java.util.Set<org.apache.maven.artifact.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(org.apache.maven.model.IssueManagement issueManagement)voidsetLicenses(java.util.List<org.apache.maven.model.License> licenses)voidsetMailingLists(java.util.List<org.apache.maven.model.MailingList> mailingLists)voidsetManagedVersionMap(java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> map)voidsetModel(org.apache.maven.model.Model model)voidsetModelVersion(java.lang.String pomVersion)voidsetName(java.lang.String name)voidsetOrganization(org.apache.maven.model.Organization organization)voidsetOriginalModel(org.apache.maven.model.Model originalModel)voidsetPackaging(java.lang.String packaging)voidsetParent(MavenProject parent)voidsetParentArtifact(org.apache.maven.artifact.Artifact parentArtifact)voidsetParentFile(java.io.File parentFile)voidsetPluginArtifactRepositories(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> pluginArtifactRepositories)voidsetPluginArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> pluginArtifacts)voidsetPomFile(java.io.File file)Sets projectfilewithout changing projectbasedir.voidsetProjectBuildingRequest(ProjectBuildingRequest projectBuildingRequest)Deprecated.voidsetReleaseArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository releaseArtifactRepository)voidsetRemoteArtifactRepositories(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories)voidsetReportArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> reportArtifacts)Deprecated.voidsetReporting(org.apache.maven.model.Reporting reporting)Deprecated.voidsetResolvedArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> artifacts)Sets the transitive dependency artifacts that have been resolved/collected for this project.voidsetScm(org.apache.maven.model.Scm scm)protected voidsetScriptSourceRoots(java.util.List<java.lang.String> scriptSourceRoots)Deprecated.voidsetSnapshotArtifactRepository(org.apache.maven.artifact.repository.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
-
-
Constructor Detail
-
MavenProject
public MavenProject()
-
MavenProject
public MavenProject(org.apache.maven.model.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 org.apache.maven.artifact.Artifact getArtifact()
-
setArtifact
public void setArtifact(org.apache.maven.artifact.Artifact artifact)
-
getModel
public org.apache.maven.model.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<org.apache.maven.model.Dependency> dependencies)
-
getDependencies
public java.util.List<org.apache.maven.model.Dependency> getDependencies()
-
getDependencyManagement
public org.apache.maven.model.DependencyManagement getDependencyManagement()
-
addCompileSourceRoot
public void addCompileSourceRoot(java.lang.String path)
Adds the specified path to the list of compile source roots for this project.- Parameters:
path- the source root to add
-
removeCompileSourceRoot
public void removeCompileSourceRoot(java.lang.String path)
Removes the specified path from the list of compile source roots.- Parameters:
path- the source root to remove- Since:
- 3.9.10
-
addTestCompileSourceRoot
public void addTestCompileSourceRoot(java.lang.String path)
Adds the specified path to the list of test compile source roots for this project.- Parameters:
path- the test source root to add
-
removeTestCompileSourceRoot
public void removeTestCompileSourceRoot(java.lang.String path)
Removes the specified path from the list of test compile source roots.- Parameters:
path- the test source root to remove- Since:
- 3.9.10
-
getCompileSourceRoots
public java.util.List<java.lang.String> getCompileSourceRoots()
Gets the list of compile source roots for this project.Note: The collection returned by this method should not be modified directly. Use
addCompileSourceRoot(String)andremoveCompileSourceRoot(String)methods instead.- Returns:
- a list of compile source roots
-
getTestCompileSourceRoots
public java.util.List<java.lang.String> getTestCompileSourceRoots()
Gets the list of test compile source roots for this project.Note: The collection returned by this method should not be modified directly. Use
addTestCompileSourceRoot(String)andremoveTestCompileSourceRoot(String)methods instead.- Returns:
- a list of test compile source roots
-
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 org.apache.maven.model.Prerequisites getPrerequisites()
-
setIssueManagement
public void setIssueManagement(org.apache.maven.model.IssueManagement issueManagement)
-
getCiManagement
public org.apache.maven.model.CiManagement getCiManagement()
-
setCiManagement
public void setCiManagement(org.apache.maven.model.CiManagement ciManagement)
-
getIssueManagement
public org.apache.maven.model.IssueManagement getIssueManagement()
-
setDistributionManagement
public void setDistributionManagement(org.apache.maven.model.DistributionManagement distributionManagement)
-
getDistributionManagement
public org.apache.maven.model.DistributionManagement getDistributionManagement()
-
setDescription
public void setDescription(java.lang.String description)
-
getDescription
public java.lang.String getDescription()
-
setOrganization
public void setOrganization(org.apache.maven.model.Organization organization)
-
getOrganization
public org.apache.maven.model.Organization getOrganization()
-
setScm
public void setScm(org.apache.maven.model.Scm scm)
-
getScm
public org.apache.maven.model.Scm getScm()
-
setMailingLists
public void setMailingLists(java.util.List<org.apache.maven.model.MailingList> mailingLists)
-
getMailingLists
public java.util.List<org.apache.maven.model.MailingList> getMailingLists()
-
addMailingList
public void addMailingList(org.apache.maven.model.MailingList mailingList)
-
setDevelopers
public void setDevelopers(java.util.List<org.apache.maven.model.Developer> developers)
-
getDevelopers
public java.util.List<org.apache.maven.model.Developer> getDevelopers()
-
addDeveloper
public void addDeveloper(org.apache.maven.model.Developer developer)
-
setContributors
public void setContributors(java.util.List<org.apache.maven.model.Contributor> contributors)
-
getContributors
public java.util.List<org.apache.maven.model.Contributor> getContributors()
-
addContributor
public void addContributor(org.apache.maven.model.Contributor contributor)
-
setBuild
public void setBuild(org.apache.maven.model.Build build)
-
getBuild
public org.apache.maven.model.Build getBuild()
-
getResources
public java.util.List<org.apache.maven.model.Resource> getResources()
-
getTestResources
public java.util.List<org.apache.maven.model.Resource> getTestResources()
-
addResource
public void addResource(org.apache.maven.model.Resource resource)
-
addTestResource
public void addTestResource(org.apache.maven.model.Resource testResource)
-
setLicenses
public void setLicenses(java.util.List<org.apache.maven.model.License> licenses)
-
getLicenses
public java.util.List<org.apache.maven.model.License> getLicenses()
-
addLicense
public void addLicense(org.apache.maven.model.License license)
-
setArtifacts
public void setArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> artifacts)
-
getArtifacts
public java.util.Set<org.apache.maven.artifact.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,org.apache.maven.artifact.Artifact> getArtifactMap()
-
setPluginArtifacts
public void setPluginArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> pluginArtifacts)
-
getPluginArtifacts
public java.util.Set<org.apache.maven.artifact.Artifact> getPluginArtifacts()
-
getPluginArtifactMap
public java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> getPluginArtifactMap()
-
setParentArtifact
public void setParentArtifact(org.apache.maven.artifact.Artifact parentArtifact)
-
getParentArtifact
public org.apache.maven.artifact.Artifact getParentArtifact()
-
getRepositories
public java.util.List<org.apache.maven.model.Repository> getRepositories()
-
getBuildPlugins
public java.util.List<org.apache.maven.model.Plugin> getBuildPlugins()
-
getModules
public java.util.List<java.lang.String> getModules()
-
getPluginManagement
public org.apache.maven.model.PluginManagement getPluginManagement()
-
setRemoteArtifactRepositories
public void setRemoteArtifactRepositories(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories)
-
getRemoteArtifactRepositories
public java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteArtifactRepositories()
-
setPluginArtifactRepositories
public void setPluginArtifactRepositories(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> pluginArtifactRepositories)
-
getPluginArtifactRepositories
public java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> getPluginArtifactRepositories()
- Returns:
- a list of ArtifactRepository objects constructed from the Repository objects returned by getPluginRepositories.
-
getDistributionManagementArtifactRepository
public org.apache.maven.artifact.repository.ArtifactRepository getDistributionManagementArtifactRepository()
-
getPluginRepositories
public java.util.List<org.apache.maven.model.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<org.apache.maven.model.Profile> activeProfiles)
-
getActiveProfiles
public java.util.List<org.apache.maven.model.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(org.apache.maven.artifact.Artifact artifact) throws DuplicateArtifactAttachmentExceptionDeprecated.Please useMavenProjectHelperAdd 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- will never happen but leave it for backward compatibility
-
getAttachedArtifacts
public java.util.List<org.apache.maven.artifact.Artifact> getAttachedArtifacts()
Returns a mutable list of the attached artifacts to this project. It is highly advised not to modify this list, but rather use theMavenProjectHelper.Note: This list will be made read-only in Maven 4.
- Returns:
- the attached artifacts of this project
-
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<org.apache.maven.artifact.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<org.apache.maven.artifact.Artifact> dependencyArtifacts)
Deprecated.
-
setReleaseArtifactRepository
public void setReleaseArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository releaseArtifactRepository)
-
setSnapshotArtifactRepository
public void setSnapshotArtifactRepository(org.apache.maven.artifact.repository.ArtifactRepository snapshotArtifactRepository)
-
setOriginalModel
public void setOriginalModel(org.apache.maven.model.Model originalModel)
-
getOriginalModel
public org.apache.maven.model.Model getOriginalModel()
-
setManagedVersionMap
public void setManagedVersionMap(java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> map)
-
getManagedVersionMap
public java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> getManagedVersionMap()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getBuildExtensions
public java.util.List<org.apache.maven.model.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 org.apache.maven.model.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(org.apache.maven.model.Model model)
-
setAttachedArtifacts
protected void setAttachedArtifacts(java.util.List<org.apache.maven.artifact.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 org.apache.maven.artifact.repository.ArtifactRepository getReleaseArtifactRepository()
-
getSnapshotArtifactRepository
protected org.apache.maven.artifact.repository.ArtifactRepository getSnapshotArtifactRepository()
-
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<org.apache.maven.artifact.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(org.apache.maven.artifact.resolver.filter.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<org.apache.maven.artifact.Artifact> createArtifacts(ArtifactFactory artifactFactory, java.lang.String inheritedScope, org.apache.maven.artifact.resolver.filter.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<org.apache.maven.artifact.Artifact> getCompileArtifacts()
Deprecated.
-
getCompileDependencies
@Deprecated public java.util.List<org.apache.maven.model.Dependency> getCompileDependencies()
Deprecated.
-
getTestArtifacts
@Deprecated public java.util.List<org.apache.maven.artifact.Artifact> getTestArtifacts()
Deprecated.
-
getTestDependencies
@Deprecated public java.util.List<org.apache.maven.model.Dependency> getTestDependencies()
Deprecated.
-
getRuntimeDependencies
@Deprecated public java.util.List<org.apache.maven.model.Dependency> getRuntimeDependencies()
Deprecated.
-
getRuntimeArtifacts
@Deprecated public java.util.List<org.apache.maven.artifact.Artifact> getRuntimeArtifacts()
Deprecated.
-
getSystemClasspathElements
@Deprecated public java.util.List<java.lang.String> getSystemClasspathElements() throws DependencyResolutionRequiredExceptionDeprecated.
-
getSystemArtifacts
@Deprecated public java.util.List<org.apache.maven.artifact.Artifact> getSystemArtifacts()
Deprecated.
-
getSystemDependencies
@Deprecated public java.util.List<org.apache.maven.model.Dependency> getSystemDependencies()
Deprecated.
-
setReporting
@Deprecated public void setReporting(org.apache.maven.model.Reporting reporting)
Deprecated.
-
getReporting
@Deprecated public org.apache.maven.model.Reporting getReporting()
Deprecated.
-
setReportArtifacts
@Deprecated public void setReportArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> reportArtifacts)
Deprecated.
-
getReportArtifacts
@Deprecated public java.util.Set<org.apache.maven.artifact.Artifact> getReportArtifacts()
Deprecated.
-
getReportArtifactMap
@Deprecated public java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> getReportArtifactMap()
Deprecated.
-
setExtensionArtifacts
@Deprecated public void setExtensionArtifacts(java.util.Set<org.apache.maven.artifact.Artifact> extensionArtifacts)
Deprecated.
-
getExtensionArtifacts
@Deprecated public java.util.Set<org.apache.maven.artifact.Artifact> getExtensionArtifacts()
Deprecated.
-
getExtensionArtifactMap
@Deprecated public java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> getExtensionArtifactMap()
Deprecated.
-
getReportPlugins
@Deprecated public java.util.List<org.apache.maven.model.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 org.apache.maven.artifact.Artifact replaceWithActiveArtifact(org.apache.maven.artifact.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
-
-