public final class MavenDependencyImpl extends Object implements MavenDependencySPI
MavenDependency| Constructor and Description |
|---|
MavenDependencyImpl(MavenCoordinate coordinate,
ScopeType scope,
boolean optional,
boolean undeclaredScope,
MavenDependencyExclusion... exclusions)
Creates a new instance with the specified properties.
|
MavenDependencyImpl(MavenCoordinate coordinate,
ScopeType scope,
boolean optional,
MavenDependencyExclusion... exclusions)
Creates a new instance with the specified properties.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Determines whether two
MavenCoordinate instances are equal by value; all fields are considered except
for version |
String |
getArtifactId()
Returns the "artifactId" portion of this artifact's coordinates
|
String |
getClassifier()
Returns the "classifier" portion of this artifact's coordinates.
|
Set<MavenDependencyExclusion> |
getExclusions()
Returns the exclusions defined for this
MavenDependency in an immutable, read-only view. |
String |
getGroupId()
Returns the "groupId" portion of this artifact's coordinates
|
PackagingType |
getPackaging()
Returns the "packaging" portion of this artifact's coordinates; always returns a value.
|
ScopeType |
getScope()
Returns the scope for this
MavenDependency. |
PackagingType |
getType()
Alias to
MavenCoordinate.getPackaging(). |
String |
getVersion()
Returns the declared "version" portion of this artifact's coordinates, for instance "1.2.0-alpha-2" or
"1.2.0-SNAPSHOT".
|
int |
hashCode() |
boolean |
isOptional()
Returns whether or not this
MavenDependency has been marked as optional; defaults to
false |
boolean |
isUndeclaredScope()
Denotes that the scope defined here should be treated as undeclared (as brought in via
<dependencyManagement with no scope associated) |
String |
toCanonicalForm()
Returns the canonical form of this
Coordinate |
String |
toString() |
public MavenDependencyImpl(MavenCoordinate coordinate, ScopeType scope, boolean optional, MavenDependencyExclusion... exclusions)
ScopeType is specified, default will be
ScopeType.COMPILE. undeclaredScope will be set to falsecoordinate - A coordinate
Delegate, requiredscope - A scopeoptional - Whether or not this MavenDependency has been marked as optional.exclusions - MavenDependencyExclusions, if null will be ignoredpublic MavenDependencyImpl(MavenCoordinate coordinate, ScopeType scope, boolean optional, boolean undeclaredScope, MavenDependencyExclusion... exclusions)
ScopeType is specified, default will be
ScopeType.COMPILE.coordinate - A coordinate
Delegate, requiredscope - A scopeoptional - Whether or not this MavenDependency has been marked as optional.undeclaredScope - Whether there is no scopeexclusions - MavenDependencyExclusions, if null will be ignoredpublic String getGroupId()
org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenGABaseImpl#getGroupId()public String toCanonicalForm()
CoordinateCoordinateCoordinate.toCanonicalForm()public String getArtifactId()
org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenGABaseImpl#getArtifactId()public PackagingType getPackaging()
PackagingType.JAR.getPackaging in interface MavenCoordinateMavenCoordinate.getPackaging()public PackagingType getType()
MavenCoordinate.getPackaging().getType in interface MavenCoordinateMavenCoordinate.getType()public String getClassifier()
getClassifier in interface MavenCoordinateMavenCoordinate.getClassifier()public String getVersion()
MavenArtifactInfo.getResolvedVersion().getVersion in interface MavenCoordinatenull.MavenCoordinate.getVersion()public Set<MavenDependencyExclusion> getExclusions()
MavenDependency in an immutable, read-only view. If no
exclusions are defined, an empty Set will be returned.getExclusions in interface MavenDependencyMavenDependency in an immutable, read-only view.
An empty Set if no exclusions are defined.MavenDependency.getExclusions()public ScopeType getScope()
MavenDependency. Never returns null; if no scope has been
explicitly-defined, the default ScopeType.COMPILE will be returned.getScope in interface MavenDependencyMavenDependency. The default ScopeType.COMPILE if no scope has been
explicitly-defined. Never returns null.MavenDependency.getScope()public boolean isOptional()
MavenDependency has been marked as optional; defaults to
falseisOptional in interface MavenDependencyMavenDependency has been marked as optional. Defaults to falseMavenDependency.isOptional()public boolean isUndeclaredScope()
<dependencyManagement with no scope associated)isUndeclaredScope in interface MavenDependencySPIMavenDependencySPI.isUndeclaredScope()public int hashCode()
hashCode in interface MavenCoordinatehashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
MavenCoordinate instances are equal by value; all fields are considered except
for versionequals in interface MavenCoordinateequals in class ObjectObject.equals(java.lang.Object)public String toString()
toString in class ObjectObject.toString()Copyright © 2022 JBoss by Red Hat. All rights reserved.