|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ops4j.pax.construct.util.XppPom
public class XppPom
Support round-trip editing of Maven POMs, preserving comments and formatting as much as possible
Constructor Summary | |
---|---|
XppPom(java.io.File pomFile)
Read Maven project details from existing file |
|
XppPom(java.io.File pomFile,
java.lang.String groupId,
java.lang.String artifactId)
Create blank Maven project module |
Method Summary | |
---|---|
void |
addDependency(org.apache.maven.model.Dependency dependency,
boolean overwrite)
|
void |
addExclusion(java.lang.String groupId,
java.lang.String artifactId,
boolean overwrite)
|
void |
addModule(java.lang.String module,
boolean overwrite)
|
void |
addRepository(org.apache.maven.model.Repository repository,
boolean snapshots,
boolean releases,
boolean overwrite,
boolean pluginRepo)
|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getArtifactId()
|
java.io.File |
getBasedir()
|
java.lang.String |
getBundleSymbolicName()
|
PomUtils.Pom |
getContainingPom()
|
java.io.File |
getFile()
|
java.lang.String |
getGroupId()
|
java.lang.String |
getId()
|
java.util.List |
getModuleNames()
|
PomUtils.Pom |
getModulePom(java.lang.String name)
|
java.lang.String |
getPackaging()
|
java.lang.String |
getParentId()
|
java.util.Properties |
getProperties()
|
java.lang.String |
getVersion()
|
int |
hashCode()
|
boolean |
isBundleProject()
|
void |
mergeSection(PomUtils.Pom pom,
java.lang.String fromSection,
java.lang.String toSection,
boolean append)
Merge a section of XML from another Maven project POM |
void |
overlayDetails(PomUtils.Pom pom)
Overlay POM template with detail from another Maven project POM |
boolean |
removeDependency(org.apache.maven.model.Dependency dependency)
|
boolean |
removeExclusion(java.lang.String groupId,
java.lang.String artifactId)
|
boolean |
removeModule(java.lang.String module)
|
void |
setGroupId(java.lang.String newGroupId)
|
void |
setParent(org.apache.maven.project.MavenProject project,
java.lang.String relativePath,
boolean overwrite)
|
void |
setParent(PomUtils.Pom pom,
java.lang.String relativePath,
boolean overwrite)
|
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
setVersion(java.lang.String newVersion)
|
java.lang.String |
toString()
|
boolean |
updateDependencyGroup(org.apache.maven.model.Dependency dependency,
java.lang.String newGroupId)
|
boolean |
updatePluginVersion(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String newVersion)
|
void |
write()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XppPom(java.io.File pomFile) throws java.io.IOException
pomFile
- XML file containing Maven project model
java.io.IOException
public XppPom(java.io.File pomFile, java.lang.String groupId, java.lang.String artifactId)
pomFile
- XML file, may or may not existgroupId
- project group idartifactId
- project artifact idMethod Detail |
---|
public java.lang.String getId()
getId
in interface PomUtils.Pom
public java.lang.String getParentId()
getParentId
in interface PomUtils.Pom
public java.lang.String getGroupId()
getGroupId
in interface PomUtils.Pom
public java.lang.String getArtifactId()
getArtifactId
in interface PomUtils.Pom
public java.lang.String getVersion()
getVersion
in interface PomUtils.Pom
public java.lang.String getPackaging()
getPackaging
in interface PomUtils.Pom
public java.util.List getModuleNames()
getModuleNames
in interface PomUtils.Pom
public PomUtils.Pom getContainingPom()
getContainingPom
in interface PomUtils.Pom
public PomUtils.Pom getModulePom(java.lang.String name)
getModulePom
in interface PomUtils.Pom
name
- name of a module in this project
public java.io.File getFile()
getFile
in interface PomUtils.Pom
public java.io.File getBasedir()
getBasedir
in interface PomUtils.Pom
public boolean isBundleProject()
isBundleProject
in interface PomUtils.Pom
public java.lang.String getBundleSymbolicName()
getBundleSymbolicName
in interface PomUtils.Pom
public void setParent(PomUtils.Pom pom, java.lang.String relativePath, boolean overwrite) throws PomUtils.ExistingElementException
setParent
in interface PomUtils.Pom
pom
- the new logical parent projectrelativePath
- the relative path from this POM to its new parentoverwrite
- overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementException
public void setParent(org.apache.maven.project.MavenProject project, java.lang.String relativePath, boolean overwrite) throws PomUtils.ExistingElementException
setParent
in interface PomUtils.Pom
project
- the new logical parent projectrelativePath
- the relative path from this POM to the parentoverwrite
- overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementException
public void setGroupId(java.lang.String newGroupId)
setGroupId
in interface PomUtils.Pom
newGroupId
- the new project group idpublic void setVersion(java.lang.String newVersion)
setVersion
in interface PomUtils.Pom
newVersion
- the new project versionpublic void addRepository(org.apache.maven.model.Repository repository, boolean snapshots, boolean releases, boolean overwrite, boolean pluginRepo) throws PomUtils.ExistingElementException
addRepository
in interface PomUtils.Pom
repository
- a Maven repositorysnapshots
- enable snapshots for this repositoryreleases
- enable releases for this repositoryoverwrite
- overwrite element if true, otherwise throw PomUtils.ExistingElementException
pluginRepo
- treat as plugin repository if true, otherwise assume normal repository
PomUtils.ExistingElementException
public void addModule(java.lang.String module, boolean overwrite) throws PomUtils.ExistingElementException
addModule
in interface PomUtils.Pom
module
- module nameoverwrite
- overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementException
public boolean removeModule(java.lang.String module)
removeModule
in interface PomUtils.Pom
module
- module name
public void addDependency(org.apache.maven.model.Dependency dependency, boolean overwrite) throws PomUtils.ExistingElementException
addDependency
in interface PomUtils.Pom
dependency
- project dependencyoverwrite
- overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementException
public boolean updateDependencyGroup(org.apache.maven.model.Dependency dependency, java.lang.String newGroupId)
updateDependencyGroup
in interface PomUtils.Pom
dependency
- project dependencynewGroupId
- updated dependency group id
public boolean removeDependency(org.apache.maven.model.Dependency dependency)
removeDependency
in interface PomUtils.Pom
dependency
- project dependency
public void addExclusion(java.lang.String groupId, java.lang.String artifactId, boolean overwrite) throws PomUtils.ExistingElementException
addExclusion
in interface PomUtils.Pom
groupId
- dependency exclusion group idartifactId
- dependency exclusion artifact idoverwrite
- overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementException
public boolean removeExclusion(java.lang.String groupId, java.lang.String artifactId)
removeExclusion
in interface PomUtils.Pom
groupId
- dependency exclusion group idartifactId
- dependency exclusion artifact id
public java.util.Properties getProperties()
getProperties
in interface PomUtils.Pom
public void setProperty(java.lang.String key, java.lang.String value)
setProperty
in interface PomUtils.Pom
key
- property keyvalue
- property valuepublic boolean updatePluginVersion(java.lang.String groupId, java.lang.String artifactId, java.lang.String newVersion)
updatePluginVersion
in interface PomUtils.Pom
groupId
- plugin group idartifactId
- plugin artifact idnewVersion
- new plugin version
public void mergeSection(PomUtils.Pom pom, java.lang.String fromSection, java.lang.String toSection, boolean append)
mergeSection
in interface PomUtils.Pom
pom
- another Maven projectfromSection
- path to XML section to merge fromtoSection
- path to XML section to merge intoappend
- when true, append instead of mergingpublic void overlayDetails(PomUtils.Pom pom)
overlayDetails
in interface PomUtils.Pom
pom
- another Maven projectpublic void write() throws java.io.IOException
write
in interface PomUtils.Pom
java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |