org.apache.maven.project

Class MavenProject

public class MavenProject extends Object

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.

We need to leave the model intact because we don't want the following:

  1. We don't want interpolated values being written back into the model.
  2. We don't want inherited values being written back into the model.
Field Summary
static StringEMPTY_PROJECT_ARTIFACT_ID
static StringEMPTY_PROJECT_GROUP_ID
static StringEMPTY_PROJECT_VERSION
Constructor Summary
MavenProject()
MavenProject(Model model)
MavenProject(MavenProject project)
Method Summary
voidaddAttachedArtifact(Artifact artifact)
voidaddCompileSourceRoot(String path)
voidaddContributor(Contributor contributor)
voidaddDeveloper(Developer developer)
voidaddLicense(License license)
voidaddMailingList(MailingList mailingList)
voidaddPlugin(Plugin plugin)
voidaddProjectReference(MavenProject project)
voidaddResource(Resource resource)
voidaddScriptSourceRoot(String path)
voidaddTestCompileSourceRoot(String path)
voidaddTestResource(Resource testResource)
voidattachArtifact(String type, String classifier, File file)
SetcreateArtifacts(ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter dependencyFilter)
booleanequals(Object other)
ListgetActiveProfiles()
ArtifactgetArtifact()
StringgetArtifactId()
MapgetArtifactMap()
SetgetArtifacts()
ListgetAttachedArtifacts()
FilegetBasedir()
BuildgetBuild()
ListgetBuildExtensions()
ListgetBuildPlugins()
CiManagementgetCiManagement()
ListgetCollectedProjects()
ListgetCompileArtifacts()
ListgetCompileClasspathElements()
ListgetCompileDependencies()
ListgetCompileSourceRoots()
ListgetContributors()
StringgetDefaultGoal()
ListgetDependencies()
SetgetDependencyArtifacts()
DependencyManagementgetDependencyManagement()
StringgetDescription()
ListgetDevelopers()
DistributionManagementgetDistributionManagement()
ArtifactRepositorygetDistributionManagementArtifactRepository()
MavenProjectgetExecutionProject()
MapgetExtensionArtifactMap()
SetgetExtensionArtifacts()
FilegetFile()
ListgetFilters()
Xpp3DomgetGoalConfiguration(String pluginGroupId, String pluginArtifactId, String executionId, String goalId)
StringgetGroupId()
StringgetId()
StringgetInceptionYear()
IssueManagementgetIssueManagement()
ListgetLicenses()
ListgetMailingLists()
ModelgetModel()
StringgetModelVersion()
StringgetModulePathAdjustment(MavenProject moduleProject)
ListgetModules()
StringgetName()
OrganizationgetOrganization()
ModelgetOriginalModel()
StringgetPackaging()
MavenProjectgetParent()
ArtifactgetParentArtifact()
MapgetPluginArtifactMap()
ListgetPluginArtifactRepositories()
SetgetPluginArtifacts()
PluginManagementgetPluginManagement()
ListgetPluginRepositories()
PrerequisitesgetPrerequisites()
MapgetProjectReferences()
PropertiesgetProperties()
ListgetRemoteArtifactRepositories()
MapgetReportArtifactMap()
SetgetReportArtifacts()
Xpp3DomgetReportConfiguration(String pluginGroupId, String pluginArtifactId, String reportSetId)
ReportinggetReporting()
ListgetReportPlugins()
ListgetRepositories()
ListgetResources()
ListgetRuntimeArtifacts()
ListgetRuntimeClasspathElements()
ListgetRuntimeDependencies()
ScmgetScm()
ListgetScriptSourceRoots()
ListgetSystemArtifacts()
ListgetSystemClasspathElements()
ListgetSystemDependencies()
ListgetTestArtifacts()
ListgetTestClasspathElements()
ListgetTestCompileSourceRoots()
ListgetTestDependencies()
ListgetTestResources()
StringgetUrl()
StringgetVersion()
inthashCode()
booleanhasParent()
voidinjectPluginManagementInfo(Plugin plugin)
booleanisExecutionRoot()
ArtifactreplaceWithActiveArtifact(Artifact pluginArtifact)
voidsetActiveProfiles(List activeProfiles)
voidsetArtifact(Artifact artifact)
voidsetArtifactId(String artifactId)
voidsetArtifacts(Set artifacts)
voidsetBuild(Build build)
voidsetCiManagement(CiManagement ciManagement)
voidsetCollectedProjects(List collectedProjects)
voidsetContributors(List contributors)
voidsetDependencies(List dependencies)
voidsetDependencyArtifacts(Set dependencyArtifacts)
voidsetDescription(String description)
voidsetDevelopers(List developers)
voidsetDistributionManagement(DistributionManagement distributionManagement)
voidsetExecutionProject(MavenProject executionProject)
voidsetExecutionRoot(boolean executionRoot)
voidsetExtensionArtifacts(Set extensionArtifacts)
voidsetFile(File file)
voidsetGroupId(String groupId)
voidsetInceptionYear(String inceptionYear)
voidsetIssueManagement(IssueManagement issueManagement)
voidsetLicenses(List licenses)
voidsetMailingLists(List mailingLists)
voidsetModelVersion(String pomVersion)
voidsetName(String name)
voidsetOrganization(Organization organization)
voidsetOriginalModel(Model originalModel)
voidsetPackaging(String packaging)
voidsetParent(MavenProject parent)
voidsetParentArtifact(Artifact parentArtifact)
voidsetPluginArtifactRepositories(List pluginArtifactRepositories)
voidsetPluginArtifacts(Set pluginArtifacts)
voidsetReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository)
voidsetRemoteArtifactRepositories(List remoteArtifactRepositories)
voidsetReportArtifacts(Set reportArtifacts)
voidsetReporting(Reporting reporting)
voidsetScm(Scm scm)
voidsetSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository)
voidsetUrl(String url)
voidsetVersion(String version)
voidwriteModel(Writer writer)
voidwriteOriginalModel(Writer writer)

Field Detail

EMPTY_PROJECT_ARTIFACT_ID

public static final String EMPTY_PROJECT_ARTIFACT_ID

EMPTY_PROJECT_GROUP_ID

public static final String EMPTY_PROJECT_GROUP_ID

EMPTY_PROJECT_VERSION

public static final String EMPTY_PROJECT_VERSION

Constructor Detail

MavenProject

public MavenProject()

MavenProject

public MavenProject(Model model)

MavenProject

public MavenProject(MavenProject project)

Method Detail

addAttachedArtifact

public void addAttachedArtifact(Artifact artifact)

addCompileSourceRoot

public void addCompileSourceRoot(String path)

addContributor

public void addContributor(Contributor contributor)

addDeveloper

public void addDeveloper(Developer developer)

addLicense

public void addLicense(License license)

addMailingList

public void addMailingList(MailingList mailingList)

addPlugin

public void addPlugin(Plugin plugin)

addProjectReference

public void addProjectReference(MavenProject project)

addResource

public void addResource(Resource resource)

addScriptSourceRoot

public void addScriptSourceRoot(String path)

addTestCompileSourceRoot

public void addTestCompileSourceRoot(String path)

addTestResource

public void addTestResource(Resource testResource)

attachArtifact

public void attachArtifact(String type, String classifier, File file)

Deprecated: Use MavenProjectHelper.attachArtifact(..) instead.

createArtifacts

public Set createArtifacts(ArtifactFactory artifactFactory, String inheritedScope, ArtifactFilter dependencyFilter)

UNKNOWN: the lazy initialisation of this makes me uneasy.

equals

public boolean equals(Object other)

getActiveProfiles

public List getActiveProfiles()

getArtifact

public Artifact getArtifact()

getArtifactId

public String getArtifactId()

getArtifactMap

public Map getArtifactMap()

getArtifacts

public Set getArtifacts()

getAttachedArtifacts

public List getAttachedArtifacts()

getBasedir

public File getBasedir()

getBuild

public Build getBuild()

getBuildExtensions

public List getBuildExtensions()

getBuildPlugins

public List getBuildPlugins()

getCiManagement

public CiManagement getCiManagement()

getCollectedProjects

public List getCollectedProjects()

getCompileArtifacts

public List getCompileArtifacts()

getCompileClasspathElements

public List getCompileClasspathElements()

getCompileDependencies

public List getCompileDependencies()

getCompileSourceRoots

public List getCompileSourceRoots()

getContributors

public List getContributors()

getDefaultGoal

public String getDefaultGoal()

getDependencies

public List getDependencies()

getDependencyArtifacts

public Set getDependencyArtifacts()

getDependencyManagement

public DependencyManagement getDependencyManagement()

getDescription

public String getDescription()

getDevelopers

public List getDevelopers()

getDistributionManagement

public DistributionManagement getDistributionManagement()

getDistributionManagementArtifactRepository

public ArtifactRepository getDistributionManagementArtifactRepository()

getExecutionProject

public MavenProject getExecutionProject()

getExtensionArtifactMap

public Map getExtensionArtifactMap()

getExtensionArtifacts

public Set getExtensionArtifacts()

getFile

public File getFile()

getFilters

public List getFilters()

getGoalConfiguration

public Xpp3Dom getGoalConfiguration(String pluginGroupId, String pluginArtifactId, String executionId, String goalId)

getGroupId

public String getGroupId()

getId

public String getId()

getInceptionYear

public String getInceptionYear()

getIssueManagement

public IssueManagement getIssueManagement()

getLicenses

public List getLicenses()

getMailingLists

public List getMailingLists()

getModel

public Model getModel()

getModelVersion

public String getModelVersion()

getModulePathAdjustment

public String getModulePathAdjustment(MavenProject moduleProject)

getModules

public List getModules()

getName

public String getName()

getOrganization

public Organization getOrganization()

getOriginalModel

public Model getOriginalModel()

getPackaging

public String getPackaging()

getParent

public MavenProject getParent()

getParentArtifact

public Artifact getParentArtifact()

getPluginArtifactMap

public Map getPluginArtifactMap()

getPluginArtifactRepositories

public List getPluginArtifactRepositories()

Returns: a list of ArtifactRepository objects constructed from the Repository objects returned by getPluginRepositories.

getPluginArtifacts

public Set getPluginArtifacts()

getPluginManagement

public PluginManagement getPluginManagement()

getPluginRepositories

public List getPluginRepositories()

getPrerequisites

public Prerequisites getPrerequisites()

getProjectReferences

public Map getProjectReferences()

getProperties

public Properties getProperties()

getRemoteArtifactRepositories

public List getRemoteArtifactRepositories()

getReportArtifactMap

public Map getReportArtifactMap()

getReportArtifacts

public Set getReportArtifacts()

getReportConfiguration

public Xpp3Dom getReportConfiguration(String pluginGroupId, String pluginArtifactId, String reportSetId)

getReporting

public Reporting getReporting()

getReportPlugins

public List getReportPlugins()

getRepositories

public List getRepositories()

getResources

public List getResources()

getRuntimeArtifacts

public List getRuntimeArtifacts()

getRuntimeClasspathElements

public List getRuntimeClasspathElements()

getRuntimeDependencies

public List getRuntimeDependencies()

getScm

public Scm getScm()

getScriptSourceRoots

public List getScriptSourceRoots()

getSystemArtifacts

public List getSystemArtifacts()

getSystemClasspathElements

public List getSystemClasspathElements()

getSystemDependencies

public List getSystemDependencies()

getTestArtifacts

public List getTestArtifacts()

getTestClasspathElements

public List getTestClasspathElements()

getTestCompileSourceRoots

public List getTestCompileSourceRoots()

getTestDependencies

public List getTestDependencies()

getTestResources

public List getTestResources()

getUrl

public String getUrl()

getVersion

public String getVersion()

hashCode

public int hashCode()

hasParent

public boolean hasParent()

injectPluginManagementInfo

public void injectPluginManagementInfo(Plugin plugin)

isExecutionRoot

public boolean isExecutionRoot()

replaceWithActiveArtifact

public Artifact replaceWithActiveArtifact(Artifact pluginArtifact)

setActiveProfiles

public void setActiveProfiles(List activeProfiles)

setArtifact

public void setArtifact(Artifact artifact)

setArtifactId

public void setArtifactId(String artifactId)

setArtifacts

public void setArtifacts(Set artifacts)

setBuild

public void setBuild(Build build)

setCiManagement

public void setCiManagement(CiManagement ciManagement)

setCollectedProjects

public void setCollectedProjects(List collectedProjects)

setContributors

public void setContributors(List contributors)

setDependencies

public void setDependencies(List dependencies)

setDependencyArtifacts

public void setDependencyArtifacts(Set dependencyArtifacts)

setDescription

public void setDescription(String description)

setDevelopers

public void setDevelopers(List developers)

setDistributionManagement

public void setDistributionManagement(DistributionManagement distributionManagement)

setExecutionProject

public void setExecutionProject(MavenProject executionProject)

setExecutionRoot

public void setExecutionRoot(boolean executionRoot)

setExtensionArtifacts

public void setExtensionArtifacts(Set extensionArtifacts)

setFile

public void setFile(File file)

setGroupId

public void setGroupId(String groupId)

setInceptionYear

public void setInceptionYear(String inceptionYear)

setIssueManagement

public void setIssueManagement(IssueManagement issueManagement)

setLicenses

public void setLicenses(List licenses)

setMailingLists

public void setMailingLists(List mailingLists)

setModelVersion

public void setModelVersion(String pomVersion)

setName

public void setName(String name)

setOrganization

public void setOrganization(Organization organization)

setOriginalModel

public void setOriginalModel(Model originalModel)

setPackaging

public void setPackaging(String packaging)

setParent

public void setParent(MavenProject parent)

setParentArtifact

public void setParentArtifact(Artifact parentArtifact)

setPluginArtifactRepositories

public void setPluginArtifactRepositories(List pluginArtifactRepositories)

setPluginArtifacts

public void setPluginArtifacts(Set pluginArtifacts)

setReleaseArtifactRepository

public void setReleaseArtifactRepository(ArtifactRepository releaseArtifactRepository)

setRemoteArtifactRepositories

public void setRemoteArtifactRepositories(List remoteArtifactRepositories)

setReportArtifacts

public void setReportArtifacts(Set reportArtifacts)

setReporting

public void setReporting(Reporting reporting)

setScm

public void setScm(Scm scm)

setSnapshotArtifactRepository

public void setSnapshotArtifactRepository(ArtifactRepository snapshotArtifactRepository)

setUrl

public void setUrl(String url)

setVersion

public void setVersion(String version)

writeModel

public void writeModel(Writer writer)

writeOriginalModel

public void writeOriginalModel(Writer writer)
Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.