public class MavenProject extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_PROJECT_ARTIFACT_ID |
static String |
EMPTY_PROJECT_GROUP_ID |
static String |
EMPTY_PROJECT_VERSION |
Constructor and Description |
---|
MavenProject() |
MavenProject(MavenProject project)
Deprecated.
use
clone() so subclasses can provide a copy of the same class |
MavenProject(Model model) |
MavenProject(Model model,
RepositorySystem repositorySystem)
Deprecated.
|
public static final String EMPTY_PROJECT_GROUP_ID
public static final String EMPTY_PROJECT_ARTIFACT_ID
public static final String EMPTY_PROJECT_VERSION
public MavenProject()
public MavenProject(Model model)
@Deprecated public MavenProject(MavenProject project)
clone()
so subclasses can provide a copy of the same class@Deprecated public MavenProject(Model model, RepositorySystem repositorySystem)
public File getParentFile()
public void setParentFile(File parentFile)
@Deprecated public Set<Artifact> createArtifacts(ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter filter) throws InvalidDependencyVersionException
public String getModulePathAdjustment(MavenProject moduleProject) throws IOException
IOException
public Artifact getArtifact()
public void setArtifact(Artifact artifact)
public MavenProject getParent()
public void setParent(MavenProject parent)
public boolean hasParent()
public File getBasedir()
public void setDependencies(List<Dependency> dependencies)
public List<Dependency> getDependencies()
public DependencyManagement getDependencyManagement()
public void addCompileSourceRoot(String path)
public void addScriptSourceRoot(String path)
public void addTestCompileSourceRoot(String path)
public List<String> getCompileSourceRoots()
public List<String> getScriptSourceRoots()
public List<String> getTestCompileSourceRoots()
public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException
@Deprecated public List<Artifact> getCompileArtifacts()
@Deprecated public List<Dependency> getCompileDependencies()
public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException
@Deprecated public List<Artifact> getTestArtifacts()
@Deprecated public List<Dependency> getTestDependencies()
public List<String> getRuntimeClasspathElements() throws DependencyResolutionRequiredException
@Deprecated public List<Artifact> getRuntimeArtifacts()
@Deprecated public List<Dependency> getRuntimeDependencies()
public List<String> getSystemClasspathElements() throws DependencyResolutionRequiredException
@Deprecated public List<Artifact> getSystemArtifacts()
@Deprecated public List<Dependency> getSystemDependencies()
public void setModelVersion(String pomVersion)
public String getModelVersion()
public void setGroupId(String groupId)
public String getGroupId()
public void setArtifactId(String artifactId)
public String getArtifactId()
public void setVersion(String version)
public String getVersion()
public String getPackaging()
public void setPackaging(String packaging)
public void setInceptionYear(String inceptionYear)
public String getInceptionYear()
public Prerequisites getPrerequisites()
public void setIssueManagement(IssueManagement issueManagement)
public CiManagement getCiManagement()
public void setCiManagement(CiManagement ciManagement)
public IssueManagement getIssueManagement()
public void setDistributionManagement(DistributionManagement distributionManagement)
public DistributionManagement getDistributionManagement()
public void setDescription(String description)
public String getDescription()
public void setOrganization(Organization organization)
public Organization getOrganization()
public void setMailingLists(List<MailingList> mailingLists)
public List<MailingList> getMailingLists()
public void addMailingList(MailingList mailingList)
public void setDevelopers(List<Developer> developers)
public List<Developer> getDevelopers()
public void addDeveloper(Developer developer)
public void setContributors(List<Contributor> contributors)
public List<Contributor> getContributors()
public void addContributor(Contributor contributor)
public List<Resource> getResources()
public List<Resource> getTestResources()
public void addResource(Resource resource)
public void addTestResource(Resource testResource)
@Deprecated public void setReporting(Reporting reporting)
@Deprecated public Reporting getReporting()
public void setLicenses(List<License> licenses)
public List<License> getLicenses()
public void addLicense(License license)
public void setArtifacts(Set<Artifact> artifacts)
public Set<Artifact> getArtifacts()
Set
< Artifact
>to get only direct dependencies
public Map<String,Artifact> getArtifactMap()
public void setPluginArtifacts(Set<Artifact> pluginArtifacts)
public Set<Artifact> getPluginArtifacts()
public Map<String,Artifact> getPluginArtifactMap()
@Deprecated public void setReportArtifacts(Set<Artifact> reportArtifacts)
@Deprecated public Set<Artifact> getReportArtifacts()
@Deprecated public Map<String,Artifact> getReportArtifactMap()
public void setExtensionArtifacts(Set<Artifact> extensionArtifacts)
public Set<Artifact> getExtensionArtifacts()
public Map<String,Artifact> getExtensionArtifactMap()
public void setParentArtifact(Artifact parentArtifact)
public Artifact getParentArtifact()
public List<Repository> getRepositories()
@Deprecated public List<ReportPlugin> getReportPlugins()
public List<Plugin> getBuildPlugins()
public List<String> getModules()
public PluginManagement getPluginManagement()
public void setRemoteArtifactRepositories(List<ArtifactRepository> remoteArtifactRepositories)
public List<ArtifactRepository> getRemoteArtifactRepositories()
public void setPluginArtifactRepositories(List<ArtifactRepository> pluginArtifactRepositories)
public List<ArtifactRepository> getPluginArtifactRepositories()
public ArtifactRepository getDistributionManagementArtifactRepository()
public List<Repository> getPluginRepositories()
public List<RemoteRepository> getRemoteProjectRepositories()
public List<RemoteRepository> getRemotePluginRepositories()
public void setActiveProfiles(List<Profile> activeProfiles)
public List<Profile> getActiveProfiles()
public void setInjectedProfileIds(String source, List<String> injectedProfileIds)
public Map<String,List<String>> getInjectedProfileIds()
settings.xml
. The profile identifiers are grouped by the identifier of their source, e.g. <groupId>:<artifactId>:<version>
for a POM profile or external
for profiles from the settings.xml
.null
.public void addAttachedArtifact(Artifact artifact) throws DuplicateArtifactAttachmentException
artifact
- the artifact to add or replace.DuplicateArtifactAttachmentException
public List<Artifact> getAttachedArtifacts()
public org.codehaus.plexus.util.xml.Xpp3Dom getGoalConfiguration(String pluginGroupId, String pluginArtifactId, String executionId, String goalId)
@Deprecated public org.codehaus.plexus.util.xml.Xpp3Dom getReportConfiguration(String pluginGroupId, String pluginArtifactId, String reportSetId)
public MavenProject getExecutionProject()
public void setExecutionProject(MavenProject executionProject)
public List<MavenProject> getCollectedProjects()
public void setCollectedProjects(List<MavenProject> collectedProjects)
public Set<Artifact> getDependencyArtifacts()
Set
< Artifact
>to get all transitive dependencies
public void setDependencyArtifacts(Set<Artifact> dependencyArtifacts)
public void setReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository)
public void setSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository)
public void setOriginalModel(Model originalModel)
public Model getOriginalModel()
public void setManagedVersionMap(Map<String,Artifact> map)
public Map<String,Artifact> getManagedVersionMap()
public List<Extension> getBuildExtensions()
public void addProjectReference(MavenProject project)
@Deprecated public void attachArtifact(String type, String classifier, File file)
public Properties getProperties()
public List<String> getFilters()
public Map<String,MavenProject> getProjectReferences()
public boolean isExecutionRoot()
public void setExecutionRoot(boolean executionRoot)
public String getDefaultGoal()
@Deprecated public void writeModel(Writer writer) throws IOException
ModelWriter
.IOException
@Deprecated public void writeOriginalModel(Writer writer) throws IOException
ModelWriter
.IOException
public MavenProject clone()
clone
in class Object
CloneNotSupportedException
protected void setAttachedArtifacts(List<Artifact> attachedArtifacts)
protected void setCompileSourceRoots(List<String> compileSourceRoots)
protected void setTestCompileSourceRoots(List<String> testCompileSourceRoots)
protected void setScriptSourceRoots(List<String> scriptSourceRoots)
protected ArtifactRepository getReleaseArtifactRepository()
protected ArtifactRepository getSnapshotArtifactRepository()
@Deprecated public Artifact replaceWithActiveArtifact(Artifact pluginArtifact)
public void setContextValue(String key, Object value)
null
,
the context value is removed from this project.
Context values are intended to allow core extensions to associate
derived state with project instances.public Object getContextValue(String key)
public void setClassRealm(org.codehaus.plexus.classworlds.realm.ClassRealm classRealm)
classRealm
- The class realm hosting the build extensions of this project, may be null
.public org.codehaus.plexus.classworlds.realm.ClassRealm getClassRealm()
null
.public void setExtensionDependencyFilter(DependencyFilter extensionDependencyFilter)
extensionDependencyFilter
- The dependency filter to apply to plugins, may be null
.public DependencyFilter getExtensionDependencyFilter()
null
.public void setResolvedArtifacts(Set<Artifact> artifacts)
artifacts
- The set of artifacts, may be null
.public void setArtifactFilter(ArtifactFilter artifactFilter)
artifactFilter
- The artifact filter, may be null
to exclude all artifacts.public boolean hasLifecyclePhase(String phase)
phase
- The phase to check for, must not be null
.true
if the phase has been seen.public void addLifecyclePhase(String lifecyclePhase)
lifecyclePhase
- The lifecycle phase to add, must not be null
.public ProjectBuildingRequest getProjectBuildingRequest()
null
.public void setProjectBuildingRequest(ProjectBuildingRequest projectBuildingRequest)
projectBuildingRequest
- The project building request, may be null
.Copyright © 2001–2014 The Apache Software Foundation. All rights reserved.