public final class JkModuleDependency extends java.lang.Object implements JkDependency
org.hibernate:hibernate-core:3.0.+
is a legal
description for an external module dependency.
You can also define exclusions on module dependencies so artifact or entire
module won't be catch up by the dependency manager.Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<JkModuleDependency> |
GROUP_NAME_COMPARATOR
Comparator for
JkModuleDependency sorting dependency by their group then by their name. |
Modifier and Type | Method and Description |
---|---|
JkModuleDependency |
andExclude(java.lang.Iterable<JkDepExclude> depExcludes)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
JkModuleDependency |
andExclude(JkDepExclude... depExcludes)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
JkModuleDependency |
andExclude(java.lang.String groupeAndName)
Returns a JkModuleDependency identical to this one but adding the
specified exclusion.
|
java.lang.String |
getClassifier()
Returns the classifier for this module dependency or
null if
the dependency is done on the main artifact. |
java.util.List<JkDepExclude> |
getExcludes()
Returns modules to exclude to the transitive chain.
|
java.lang.String |
getExt()
Returns the getExtension for this module dependency or
null if
the dependency is done on the the default getExtension. |
JkModuleId |
getModuleId()
Returns the getModuleId of this dependency.
|
JkVersion |
getVersion()
Returns the version of the module this dependencies is constrained to.
|
boolean |
hasUnspecifedVersion()
Returns
true if the version of the module for this dependency is not specified. |
static boolean |
isModuleDependencyDescription(java.lang.String candidate)
Returns
true if the specified candidate matches to a module description. |
boolean |
isTransitive()
Returns
true if this dependency should be resolved transitively (returning the dependencies
of this dependency recursively). |
JkModuleDependency |
isTransitive(boolean transitive)
Returns a
JkModuleDependency identical to this one but with the specified 'transitive' property. |
static JkModuleDependency |
of(JkModuleId moduleId,
JkVersion version)
Creates a
JkModuleDependency to the specified getModuleId and
JkVersionrange . |
static JkModuleDependency |
of(JkModuleId moduleId,
java.lang.String versionRange)
Creates a
JkModuleDependency to its getModuleId and
JkVersionrange . |
static JkModuleDependency |
of(JkVersionedModule versionedModule)
Creates a
JkModuleDependency to the specified versioned module. |
static JkModuleDependency |
of(java.lang.String description)
Description can be :
group:name
group:name:version
group:name:type:version
group:name:type:artifact:version
Version can be a '?' if it is unspecified.
|
static JkModuleDependency |
of(java.lang.String group,
java.lang.String name,
java.lang.String version)
Creates a
JkModuleDependency to its group, name and version
range. |
java.lang.String |
toString() |
JkModuleDependency |
withClassifier(java.lang.String classifier)
Returns a JkModuleDependency identical to this one but with the specified
classifier.
|
JkModuleDependency |
withExt(java.lang.String extension)
Returns a JkModuleDependency identical to this one but with the specified
artifact getExtension.
|
JkModuleDependency |
withVersion(JkVersion version)
Returns a JkModuleDependency identical to this one but with the specified
static version.
|
public static final java.util.Comparator<JkModuleDependency> GROUP_NAME_COMPARATOR
JkModuleDependency
sorting dependency by their group then by their name.public static JkModuleDependency of(JkModuleId moduleId, JkVersion version)
JkModuleDependency
to the specified getModuleId and
JkVersionrange
.public static JkModuleDependency of(JkVersionedModule versionedModule)
JkModuleDependency
to the specified versioned module.public static JkModuleDependency of(JkModuleId moduleId, java.lang.String versionRange)
JkModuleDependency
to its getModuleId and
JkVersionrange
.public static JkModuleDependency of(java.lang.String group, java.lang.String name, java.lang.String version)
JkModuleDependency
to its group, name and version
range. The version range can be any string accepted by
JkVersion.of(String)
.public static JkModuleDependency of(java.lang.String description)
public static boolean isModuleDependencyDescription(java.lang.String candidate)
true
if the specified candidate matches to a module description.of(String)
public boolean isTransitive()
true
if this dependency should be resolved transitively (returning the dependencies
of this dependency recursively).public JkModuleId getModuleId()
public JkVersion getVersion()
public JkModuleDependency isTransitive(boolean transitive)
JkModuleDependency
identical to this one but with the specified 'transitive' property.public boolean hasUnspecifedVersion()
true
if the version of the module for this dependency is not specified.public JkModuleDependency withVersion(JkVersion version)
null
then returned version is this one.public JkModuleDependency withClassifier(java.lang.String classifier)
public java.lang.String getClassifier()
null
if
the dependency is done on the main artifact.public JkModuleDependency withExt(java.lang.String extension)
public JkModuleDependency andExclude(JkDepExclude... depExcludes)
public JkModuleDependency andExclude(java.lang.String groupeAndName)
public JkModuleDependency andExclude(java.lang.Iterable<JkDepExclude> depExcludes)
public java.lang.String getExt()
null
if
the dependency is done on the the default getExtension.public java.util.List<JkDepExclude> getExcludes()
public java.lang.String toString()
toString
in class java.lang.Object