public final class JkCoordinateDependency extends java.lang.Object implements JkTransitivityDependency
The version or version range identify which versions are likely to be compatible with the project to build.
For example, both org.hibernate:hibernate-core:3.0.+
and
org.hibernate:hibernate-core:3.0.1
are a legal descriptions for module dependency.
Modifier and Type | Method and Description |
---|---|
JkCoordinateDependency |
andExclusion(java.lang.String moduleId)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
JkCoordinateDependency |
andExclusions(java.lang.Iterable<JkDependencyExclusion> depExcludes)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
JkCoordinateDependency |
andExclusions(JkDependencyExclusion... depExcludes)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
JkCoordinateDependency |
andExclusions(java.lang.String... moduleIds)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
boolean |
equals(java.lang.Object o) |
JkCoordinate |
getCoordinate()
Returns the getModuleId of this dependency.
|
java.util.List<JkDependencyExclusion> |
getExclusions()
Returns modules to exclude to the transitive chain.
|
java.nio.file.Path |
getIdeProjectDir()
In the IDE, a dependency can be provided by a project exporting it.
|
JkTransitivity |
getTransitivity()
Returns
true if this dependency should be resolved transitively (returning the dependencies
of this dependency recursively). |
int |
hashCode() |
boolean |
matches(JkDependency other)
Returns
true if the specified dependency matches with this one. |
static JkCoordinateDependency |
of(JkCoordinate coordinate)
Creates a
JkCoordinateDependency to the specified JkCoordinate |
static JkCoordinateDependency |
of(JkModuleId jkModuleId) |
static JkCoordinateDependency |
of(java.lang.String coordinate,
java.lang.Object... tokens) |
static JkCoordinateDependency |
of(java.lang.String moduleId,
java.lang.String version) |
java.lang.String |
toString() |
JkCoordinateDependency |
withIdeProjectDir(java.nio.file.Path path)
Returns a dependency identical to this one but with the specified project base dir.
|
JkCoordinateDependency |
withTransitivity(JkTransitivity transitivity)
Returns a
JkCoordinateDependency identical to this one but with the specified 'transitive' property. |
JkCoordinateDependency |
withVersion(JkVersion version) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isCoordinate, of, of
public static JkCoordinateDependency of(JkCoordinate coordinate)
JkCoordinateDependency
to the specified JkCoordinate
public static JkCoordinateDependency of(JkModuleId jkModuleId)
public static JkCoordinateDependency of(java.lang.String moduleId, java.lang.String version)
public static JkCoordinateDependency of(java.lang.String coordinate, java.lang.Object... tokens)
public JkTransitivity getTransitivity()
true
if this dependency should be resolved transitively (returning the dependencies
of this dependency recursively).getTransitivity
in interface JkTransitivityDependency
public JkCoordinate getCoordinate()
public JkCoordinateDependency withTransitivity(JkTransitivity transitivity)
JkCoordinateDependency
identical to this one but with the specified 'transitive' property.public JkCoordinateDependency andExclusions(JkDependencyExclusion... depExcludes)
public JkCoordinateDependency andExclusion(java.lang.String moduleId)
public JkCoordinateDependency andExclusions(java.lang.String... moduleIds)
public JkCoordinateDependency andExclusions(java.lang.Iterable<JkDependencyExclusion> depExcludes)
public java.util.List<JkDependencyExclusion> getExclusions()
public java.lang.String toString()
toString
in class java.lang.Object
public java.nio.file.Path getIdeProjectDir()
JkDependency
null
when the dependency is not coming from another project.getIdeProjectDir
in interface JkDependency
public JkCoordinateDependency withIdeProjectDir(java.nio.file.Path path)
JkDependency
withIdeProjectDir
in interface JkDependency
JkDependency.getIdeProjectDir()
public JkCoordinateDependency withVersion(JkVersion version)
public boolean matches(JkDependency other)
JkDependency
true
if the specified dependency matches with this one. Matching means that two matching dependencies can not be declared in a same dependency set as it will be considered as a duplicate or result in a conflict.
For example "com.google:guava:21.0" is matching with "com.google:guava:23.0" even if they are not equals.
matches
in interface JkDependency
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object