public class PomModel extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PomModel.PomModelBuilder
The pom model builder.
|
| Constructor and Description |
|---|
PomModel() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addDependency(Dependency dependency)
Adds a dependency to the pom model dependencies list.
|
void |
addPlugin(Plugin plugin)
Adds a plugin to the build section in the pom.
|
void |
addPluginRepository(Repository repository)
Adds a
Repository to the PomModel in the plugin repository section. |
void |
addProperty(String key,
String value)
Sets a key-valued pair in the properties map.
|
void |
addRepository(Repository repository)
Adds a
Repository to the PomModel in the repository section. |
String |
getArtifactId()
Retrieves the artifact id declared in the pom.
|
List<Dependency> |
getDependencies()
Retrieves the list of dependencies in the pom model.
|
String |
getGroupId()
Retrieves the group id declared in the pom.
|
org.apache.maven.model.Model |
getMavenModelCopy()
Retrieves a deep copy of the maven model.
|
String |
getModelVersion()
Retrieves the pom model version.
|
String |
getName()
Retrieves the name declared in the pom.
|
String |
getPackaging()
Retrieves the packaging type declared in the pom.
|
List<Plugin> |
getPlugins()
Retrieves the list of plugins declared in the build section.
|
List<org.apache.maven.model.Profile> |
getProfiles() |
Properties |
getProperties()
Retrieves the properties declared in the pom.
|
String |
getVersion()
Retrieves the version declared in the pom.
|
boolean |
removeDependency(Dependency dependency)
Removes a dependency from the pom model dependencies list.
|
void |
removePlugin(Plugin plugin)
Removes the specified plugin from the list of plugins declared in the build section.
|
Optional<Plugin> |
removePlugin(Predicate<Plugin> pluginPredicate)
Remove the first plugins that satisfies a predicate.
|
List<Plugin> |
removePlugins(Predicate<Plugin> pluginPredicate)
Remove all the plugins that satisfies a predicate.
|
void |
removeProperty(String propertyName)
Removes a property from the pom model properties.
|
void |
setArtifactId(String artifactId)
Sets the artifact id in the pom.
|
void |
setDependencies(List<Dependency> dependencies)
Sets the dependencies in the pom model.
|
void |
setGroupId(String groupId)
Sets the group id in the pom.
|
void |
setModelVersion(String modelVersion)
Sets the pom model version.
|
void |
setName(String name)
Sets the name in the pom.
|
void |
setPackaging(String packaging)
Sets the packaging type in the pom.
|
void |
setProperties(Properties properties)
Sets the properties in the pom.
|
void |
setVersion(String version)
Sets the version in the pom.
|
public List<Dependency> getDependencies()
Listpublic void setDependencies(List<Dependency> dependencies)
dependencies - the list of the dependencies to be set in the pom modelpublic boolean addDependency(Dependency dependency)
dependency - the dependencies to be added to the pom modelpublic boolean removeDependency(Dependency dependency)
dependency - the dependency to be removed from the dependencies listpublic String getPackaging()
Stringpublic org.apache.maven.model.Model getMavenModelCopy()
Modelpublic void setPackaging(String packaging)
packaging - public String getArtifactId()
Stringpublic void setArtifactId(String artifactId)
artifactId - public void setGroupId(String groupId)
groupId - public void setVersion(String version)
version - public void setName(String name)
name - public Properties getProperties()
Propertiespublic void setProperties(Properties properties)
properties - public void addProperty(String key, String value)
key - value - public void removeProperty(String propertyName)
propertyName - NullPointerException - if the key is nullpublic void setModelVersion(String modelVersion)
modelVersion - public void addPlugin(Plugin plugin)
plugin - public List<Plugin> getPlugins()
Listpublic void removePlugin(Plugin plugin)
plugin - public List<Plugin> removePlugins(Predicate<Plugin> pluginPredicate)
pluginPredicate - a predicate that evaluates to true if the plugin should be removedpublic Optional<Plugin> removePlugin(Predicate<Plugin> pluginPredicate)
pluginPredicate - a predicate that evaluates to true if the plugin should be removedpublic List<org.apache.maven.model.Profile> getProfiles()
public void addRepository(Repository repository)
Repository to the PomModel in the repository section.repository - public void addPluginRepository(Repository repository)
Repository to the PomModel in the plugin repository section.repository - Copyright © 2018 MuleSoft Inc. All rights reserved.