public class Plugin extends Object implements Comparable<Plugin>
Structured after the model used by Maven.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_GROUP_ID
The Maven groupId that will be assigned to a plugin if one is not
provided
|
| Constructor and Description |
|---|
Plugin(Element plugin)
Constructor from a POM-style XML element that defines a Maven
|
Plugin(String groupId,
String artifactId,
String version)
Constructor that takes the minimal Maven artifact coordinates.
|
Plugin(String groupId,
String artifactId,
String version,
Configuration configuration,
Collection<? extends Dependency> dependencies,
Collection<? extends Execution> executions)
Constructor that allows all fields to be set.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Plugin o) |
boolean |
equals(Object obj) |
String |
getArtifactId() |
Configuration |
getConfiguration()
Returns the top-level configuration of this plugin, if any.
|
List<Dependency> |
getDependencies() |
Element |
getElement(Document document)
|
List<Execution> |
getExecutions() |
GAV |
getGAV()
Returns the Maven-style coordinates of this plugin
|
String |
getGroupId()
Returns this plugin's groupId.
|
static String |
getGroupId(Element plugin)
Parses the plugin's Maven groupId from the given element
|
String |
getSimpleDescription() |
String |
getVersion() |
int |
hashCode() |
boolean |
hasSameCoordinates(Plugin dependency)
Indicates whether the given
Plugin has the same Maven coordinates
as this one; this is not necessarily the same as calling
equals(Object), which may compare more fields beyond the basic
coordinates. |
String |
toString() |
public static final String DEFAULT_GROUP_ID
public Plugin(Element plugin)
plugin - the XML element to parse (required)public Plugin(String groupId, String artifactId, String version)
groupId - the group ID (required)artifactId - the artifact ID (required)version - the version (required)public Plugin(String groupId, String artifactId, String version, Configuration configuration, Collection<? extends Dependency> dependencies, Collection<? extends Execution> executions)
groupId - the group ID (required)artifactId - the artifact ID (required)version - the version (required)configuration - the configuration for this plugin (optional)dependencies - the dependencies for this plugin (can be
null)executions - the executions for this plugin (can be
null)public static String getGroupId(Element plugin)
plugin - the element to parse (required)public int compareTo(Plugin o)
compareTo in interface Comparable<Plugin>public String getArtifactId()
public Configuration getConfiguration()
Executions may have their own Configurations
instead of or in addition to this configuration.null if none existspublic List<Dependency> getDependencies()
public Element getElement(Document document)
plugin - the plugin for which to create an XML Element (required)document - the document to which the element will belong (required)null elementpublic GAV getGAV()
null set of coordinatespublic String getGroupId()
public String getSimpleDescription()
public String getVersion()
public boolean hasSameCoordinates(Plugin dependency)
Plugin has the same Maven coordinates
as this one; this is not necessarily the same as calling
equals(Object), which may compare more fields beyond the basic
coordinates.plugin - the plugin to check (can be null)false if any coordinates are differentCopyright © 2009–2017 Pivotal Software, Inc.. All rights reserved.