public class MavenHelpers extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
failsafeArtifactId |
static String |
mavenPluginsGroupId |
static String |
surefireArtifactId |
| Constructor and Description |
|---|
MavenHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static org.jboss.forge.addon.maven.plugins.ConfigurationElementBuilder |
asConfigurationElementBuilder(org.jboss.forge.addon.maven.plugins.ConfigurationElement element) |
static org.jboss.forge.addon.dependencies.Coordinate |
createCoordinate(String groupId,
String artifactId,
String version) |
static org.jboss.forge.addon.dependencies.Coordinate |
createCoordinate(String groupId,
String artifactId,
String version,
String packaging) |
static boolean |
ensureMavenDependencyAdded(org.jboss.forge.addon.projects.Project project,
org.jboss.forge.addon.projects.dependencies.DependencyInstaller dependencyInstaller,
String groupId,
String artifactId,
String scope)
Returns true if the dependency was added or false if its already there
|
static org.jboss.forge.addon.maven.plugins.ConfigurationElement |
findChildByName(org.jboss.forge.addon.maven.plugins.ConfigurationElement element,
String name) |
static org.jboss.forge.addon.maven.plugins.ConfigurationElement |
findConfigurationElement(org.jboss.forge.addon.maven.plugins.Configuration config,
String name) |
static org.apache.maven.model.Plugin |
findPlugin(List<org.apache.maven.model.Plugin> plugins,
String artifactId)
Returns the maven plugin for the given artifact id or returns null if it cannot be found
|
static org.jboss.forge.addon.maven.plugins.MavenPlugin |
findPlugin(org.jboss.forge.addon.projects.Project project,
String artifactId) |
static org.jboss.forge.addon.maven.plugins.MavenPlugin |
findPlugin(org.jboss.forge.addon.projects.Project project,
String groupId,
String artifactId) |
static org.apache.maven.model.Profile |
findProfile(org.apache.maven.model.Model mavenModel,
String profileId)
Returns the profile for the given id or null if it could not be found
|
static org.jboss.forge.addon.maven.plugins.ConfigurationElement |
getConfigurationElement(org.jboss.forge.addon.maven.plugins.ConfigurationElement element,
String... names)
Returns the plugin configuration element for the given set of element names
|
static org.jboss.forge.addon.maven.plugins.ConfigurationElement |
getConfigurationElement(org.jboss.forge.addon.maven.plugins.Configuration config,
String... names)
Returns the plugin configuration element for the given set of element names
|
protected static Map<String,String> |
getGroupArtifactVersionMap() |
static org.jboss.forge.addon.maven.plugins.ConfigurationElement |
getOrCreateElement(org.jboss.forge.addon.maven.plugins.ConfigurationElement config,
String... names) |
static org.jboss.forge.addon.maven.plugins.ConfigurationElement |
getOrCreateElement(org.jboss.forge.addon.maven.plugins.Configuration config,
String name) |
static org.jboss.forge.addon.maven.plugins.ConfigurationElementBuilder |
getOrCreateElementBuilder(org.jboss.forge.addon.maven.plugins.ConfigurationElement element,
String... names) |
static String |
getVersion(String groupId,
String artifactId)
Returns the version from the list of pre-configured versions of common groupid/artifact pairs
|
static boolean |
hasDependency(List<org.apache.maven.model.Dependency> dependencies,
String groupId,
String artifactId)
Returns true if the lilst has the given dependency
|
static boolean |
hasDependency(org.apache.maven.model.Model pom,
String groupId,
String artifactId)
Returns true if the pom has the given dependency
|
static boolean |
hasManagedDependency(org.apache.maven.model.Model pom,
String groupId,
String artifactId)
Returns true if the pom has the given managed dependency
|
static boolean |
hasMavenPlugin(org.apache.maven.model.Model pom,
String groupId,
String artifactId)
Returns true if the pom has the given plugin
|
static boolean |
updatePomProperty(Properties properties,
String name,
Object value,
boolean updated)
Updates the given maven property value if value is not null and returns true if the pom has been changed
|
public static final String mavenPluginsGroupId
public static final String failsafeArtifactId
public static final String surefireArtifactId
public static org.apache.maven.model.Plugin findPlugin(List<org.apache.maven.model.Plugin> plugins, String artifactId)
public static org.jboss.forge.addon.maven.plugins.MavenPlugin findPlugin(org.jboss.forge.addon.projects.Project project,
String artifactId)
public static org.jboss.forge.addon.maven.plugins.MavenPlugin findPlugin(org.jboss.forge.addon.projects.Project project,
String groupId,
String artifactId)
public static org.apache.maven.model.Profile findProfile(org.apache.maven.model.Model mavenModel,
String profileId)
public static boolean ensureMavenDependencyAdded(org.jboss.forge.addon.projects.Project project,
org.jboss.forge.addon.projects.dependencies.DependencyInstaller dependencyInstaller,
String groupId,
String artifactId,
String scope)
public static String getVersion(String groupId, String artifactId)
public static org.jboss.forge.addon.dependencies.Coordinate createCoordinate(String groupId, String artifactId, String version)
public static org.jboss.forge.addon.dependencies.Coordinate createCoordinate(String groupId, String artifactId, String version, String packaging)
public static boolean hasMavenPlugin(org.apache.maven.model.Model pom,
String groupId,
String artifactId)
public static boolean hasDependency(org.apache.maven.model.Model pom,
String groupId,
String artifactId)
public static boolean hasDependency(List<org.apache.maven.model.Dependency> dependencies, String groupId, String artifactId)
public static boolean hasManagedDependency(org.apache.maven.model.Model pom,
String groupId,
String artifactId)
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElement getConfigurationElement(org.jboss.forge.addon.maven.plugins.Configuration config,
String... names)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElement getConfigurationElement(org.jboss.forge.addon.maven.plugins.ConfigurationElement element,
String... names)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElement findChildByName(org.jboss.forge.addon.maven.plugins.ConfigurationElement element,
String name)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElement findConfigurationElement(org.jboss.forge.addon.maven.plugins.Configuration config,
String name)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElement getOrCreateElement(org.jboss.forge.addon.maven.plugins.Configuration config,
String name)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElement getOrCreateElement(org.jboss.forge.addon.maven.plugins.ConfigurationElement config,
String... names)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElementBuilder asConfigurationElementBuilder(org.jboss.forge.addon.maven.plugins.ConfigurationElement element)
public static org.jboss.forge.addon.maven.plugins.ConfigurationElementBuilder getOrCreateElementBuilder(org.jboss.forge.addon.maven.plugins.ConfigurationElement element,
String... names)
Copyright © 2011–2015 Red Hat. All rights reserved.