public final class ModuleDependency extends Object implements Serializable
ModuleName,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
String |
artifactId |
String |
groupId |
static String |
NONE
When a plugin dependency is specified without giving a version,
the semantics of that is the latest released plugin.
|
boolean |
plugin |
static String |
UNKNOWN
For compatibility reason, this value may be used in the verion field
to indicate that the version is unknown.
|
String |
version
Version, possibly a version range.
|
| Constructor and Description |
|---|
ModuleDependency(org.apache.maven.model.Dependency dep) |
ModuleDependency(org.apache.maven.model.Extension ext) |
ModuleDependency(org.apache.maven.project.MavenProject project) |
ModuleDependency(ModuleName name,
String version) |
ModuleDependency(ModuleName name,
String version,
boolean plugin) |
ModuleDependency(org.apache.maven.model.Plugin p) |
ModuleDependency(org.apache.maven.model.ReportPlugin p) |
ModuleDependency(String groupId,
String artifactId,
String version) |
ModuleDependency(String groupId,
String artifactId,
String version,
boolean plugin) |
ModuleDependency(String groupId,
String artifactId,
String version,
String scope,
String type,
String classifier,
boolean plugin) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(ModuleDependency other)
Checks whether this ModuleDependency is satisfied by the dependency of the given ModuleDependency.
|
boolean |
equals(Object o) |
ModuleDependency |
findHighestFrom(Collection<ModuleDependency> candidates)
Given a list of ModuleDependencies (of the same groupId and artifactId),
picks the
ModuleDependency that satisfies the constraint and has the highest version. |
ModuleName |
getName() |
org.apache.maven.artifact.versioning.VersionRange |
getVersionAsRange() |
int |
hashCode() |
boolean |
isVersionRange()
Returns true if the version specification is a version range per maven version range syntax.
|
org.apache.maven.artifact.versioning.ArtifactVersion |
parseVersion() |
protected Object |
readResolve()
Upon reading from the disk, intern strings.
|
String |
toString() |
ModuleDependency |
withUnknownVersion()
Returns groupId+artifactId plus unknown version.
|
public final String groupId
public final String artifactId
public final String version
public final boolean plugin
public static final String UNKNOWN
public static final String NONE
ModuleDependency version to become
UNKNOWN, which would match any builds of the plugin.
So we use this constant to indicate a version, and this will not match anything.
ModuleDependency(Plugin),
Constant Field Valuespublic ModuleDependency(String groupId, String artifactId, String version, boolean plugin)
public ModuleDependency(String groupId, String artifactId, String version, String scope, String type, String classifier, boolean plugin)
public ModuleDependency(ModuleName name, String version)
public ModuleDependency(ModuleName name, String version, boolean plugin)
public ModuleDependency(org.apache.maven.model.Dependency dep)
public ModuleDependency(org.apache.maven.project.MavenProject project)
public ModuleDependency(org.apache.maven.model.Plugin p)
public ModuleDependency(org.apache.maven.model.ReportPlugin p)
public ModuleDependency(org.apache.maven.model.Extension ext)
public ModuleName getName()
public ModuleDependency withUnknownVersion()
public boolean isVersionRange()
public org.apache.maven.artifact.versioning.VersionRange getVersionAsRange()
throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
org.apache.maven.artifact.versioning.InvalidVersionSpecificationExceptionpublic org.apache.maven.artifact.versioning.ArtifactVersion parseVersion()
protected Object readResolve()
public boolean contains(ModuleDependency other)
other - The dependency to check for.public ModuleDependency findHighestFrom(Collection<ModuleDependency> candidates)
ModuleDependency that satisfies the constraint and has the highest version.candidates - List that represents specific (non-range) versions.Copyright © 2016–2017. All rights reserved.