|
||||||||||
| 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 id| Method Detail |
|---|
public java.lang.String getId()
getId in interface PomUtils.Pompublic java.lang.String getParentId()
getParentId in interface PomUtils.Pompublic java.lang.String getGroupId()
getGroupId in interface PomUtils.Pompublic java.lang.String getArtifactId()
getArtifactId in interface PomUtils.Pompublic java.lang.String getVersion()
getVersion in interface PomUtils.Pompublic java.lang.String getPackaging()
getPackaging in interface PomUtils.Pompublic java.util.List getModuleNames()
getModuleNames in interface PomUtils.Pompublic PomUtils.Pom getContainingPom()
getContainingPom in interface PomUtils.Pompublic PomUtils.Pom getModulePom(java.lang.String name)
getModulePom in interface PomUtils.Pomname - name of a module in this project
public java.io.File getFile()
getFile in interface PomUtils.Pompublic java.io.File getBasedir()
getBasedir in interface PomUtils.Pompublic boolean isBundleProject()
isBundleProject in interface PomUtils.Pompublic 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.Pompom - 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.Pomproject - the new logical parent projectrelativePath - the relative path from this POM to the parentoverwrite - overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementExceptionpublic void setGroupId(java.lang.String newGroupId)
setGroupId in interface PomUtils.PomnewGroupId - the new project group idpublic void setVersion(java.lang.String newVersion)
setVersion in interface PomUtils.PomnewVersion - the new project version
public void addRepository(org.apache.maven.model.Repository repository,
boolean snapshots,
boolean releases,
boolean overwrite,
boolean pluginRepo)
throws PomUtils.ExistingElementException
addRepository in interface PomUtils.Pomrepository - a Maven repositorysnapshots - enable snapshots for this repositoryreleases - enable releases for this repositoryoverwrite - overwrite element if true, otherwise throw PomUtils.ExistingElementExceptionpluginRepo - 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.Pommodule - module nameoverwrite - overwrite element if true, otherwise throw PomUtils.ExistingElementException
PomUtils.ExistingElementExceptionpublic boolean removeModule(java.lang.String module)
removeModule in interface PomUtils.Pommodule - module name
public void addDependency(org.apache.maven.model.Dependency dependency,
boolean overwrite)
throws PomUtils.ExistingElementException
addDependency in interface PomUtils.Pomdependency - 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.Pomdependency - project dependencynewGroupId - updated dependency group id
public boolean removeDependency(org.apache.maven.model.Dependency dependency)
removeDependency in interface PomUtils.Pomdependency - project dependency
public void addExclusion(java.lang.String groupId,
java.lang.String artifactId,
boolean overwrite)
throws PomUtils.ExistingElementException
addExclusion in interface PomUtils.PomgroupId - 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.PomgroupId - 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.Pomkey - property keyvalue - property value
public boolean updatePluginVersion(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String newVersion)
updatePluginVersion in interface PomUtils.PomgroupId - 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.Pompom - 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.Pompom - another Maven project
public void write()
throws java.io.IOException
write in interface PomUtils.Pomjava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic 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 | |||||||||