public class Dependency extends MetadataElement implements Describable
aliases
.Modifier and Type | Class and Description |
---|---|
static class |
Dependency.Mapping
Map several attribute of the dependency for a given compatibility range.
|
Modifier and Type | Field and Description |
---|---|
static List<String> |
SCOPE_ALL
All scope types.
|
static String |
SCOPE_ANNOTATION_PROCESSOR
Annotation Processor Scope.
|
static String |
SCOPE_COMPILE
Compile Scope.
|
static String |
SCOPE_COMPILE_ONLY
Compile Only Scope.
|
static String |
SCOPE_PROVIDED
Provided Scope.
|
static String |
SCOPE_RUNTIME
Runtime Scope.
|
static String |
SCOPE_TEST
Test Scope.
|
Constructor and Description |
---|
Dependency() |
Dependency(Dependency dependency) |
Modifier and Type | Method and Description |
---|---|
static Dependency |
create(String groupId,
String artifactId,
String version,
String scope) |
static Dependency |
createSpringBootStarter(String name) |
static Dependency |
createSpringBootStarter(String name,
String scope) |
String |
generateId()
Generate an id using the groupId and artifactId.
|
List<String> |
getAliases() |
String |
getArtifactId() |
String |
getBom() |
String |
getClassifier()
Return the classifier, can be
null to indicate that no classifier is
available. |
String |
getCompatibilityRange() |
String |
getDescription()
Returns the item description.
|
List<String> |
getFacets() |
String |
getGroupId() |
List<String> |
getKeywords() |
List<Link> |
getLinks() |
List<Dependency.Mapping> |
getMappings()
Return the dependency mapping if an attribute of the dependency differs according
to the Spring Boot version.
|
VersionRange |
getRange() |
String |
getRepository() |
String |
getScope() |
String |
getType()
Return the type, can be
null to indicate that the default type should be
used (i.e. |
String |
getVersion()
Return the default version, can be
null to indicate that the version is
managed by the project and does not need to be specified. |
String |
getVersionRequirement() |
int |
getWeight() |
boolean |
isStarter() |
boolean |
match(Version version)
Specify if this dependency is available for the specified Spring Boot version.
|
void |
resolve()
Validate the dependency and complete its state based on the available information.
|
Dependency |
resolve(Version bootVersion)
Resolve this instance according to the specified Spring Boot
Version . |
void |
setAliases(List<String> aliases) |
void |
setArtifactId(String artifactId) |
void |
setBom(String bom) |
void |
setClassifier(String classifier) |
void |
setCompatibilityRange(String compatibilityRange) |
void |
setDescription(String description) |
void |
setFacets(List<String> facets) |
void |
setGroupId(String groupId) |
void |
setKeywords(List<String> keywords) |
void |
setLinks(List<Link> links) |
void |
setMappings(List<Dependency.Mapping> mappings) |
void |
setRange(VersionRange range) |
void |
setRepository(String repository) |
void |
setScope(String scope) |
void |
setStarter(boolean starter) |
void |
setType(String type) |
void |
setVersion(String version) |
void |
setVersionRequirement(String versionRequirement) |
void |
setWeight(int weight) |
String |
toString() |
void |
updateCompatibilityRange(VersionParser versionParser) |
static Dependency |
withId(String id) |
static Dependency |
withId(String id,
String scope) |
static Dependency |
withId(String id,
String groupId,
String artifactId) |
static Dependency |
withId(String id,
String groupId,
String artifactId,
String version) |
static Dependency |
withId(String id,
String groupId,
String artifactId,
String version,
String scope) |
getId, getName, setId, setName
public static final String SCOPE_COMPILE
public static final String SCOPE_COMPILE_ONLY
public static final String SCOPE_ANNOTATION_PROCESSOR
public static final String SCOPE_RUNTIME
public static final String SCOPE_PROVIDED
public static final String SCOPE_TEST
public Dependency()
public Dependency(Dependency dependency)
public void setScope(String scope)
public void setCompatibilityRange(String compatibilityRange)
public void resolve()
public void updateCompatibilityRange(VersionParser versionParser)
public Dependency resolve(Version bootVersion)
Version
.
Return a Dependency
instance that has its state resolved against the
specified version.bootVersion
- the Spring Boot versionpublic boolean match(Version version)
version
- the version the checkpublic String generateId()
public String getGroupId()
public void setGroupId(String groupId)
public String getArtifactId()
public void setArtifactId(String artifactId)
public String getVersion()
null
to indicate that the version is
managed by the project and does not need to be specified.null
public void setVersion(String version)
public String getClassifier()
null
to indicate that no classifier is
available.null
public void setClassifier(String classifier)
public String getType()
null
to indicate that the default type should be
used (i.e. jar
).null
public void setType(String type)
public List<Dependency.Mapping> getMappings()
public void setMappings(List<Dependency.Mapping> mappings)
public String getDescription()
Describable
getDescription
in interface Describable
public void setDescription(String description)
public String getVersionRequirement()
public void setVersionRequirement(String versionRequirement)
public VersionRange getRange()
public void setRange(VersionRange range)
public String getBom()
public void setBom(String bom)
public String getRepository()
public void setRepository(String repository)
public int getWeight()
public void setWeight(int weight)
public boolean isStarter()
public void setStarter(boolean starter)
public String getScope()
public String getCompatibilityRange()
public static Dependency create(String groupId, String artifactId, String version, String scope)
public static Dependency createSpringBootStarter(String name)
public static Dependency createSpringBootStarter(String name, String scope)
public static Dependency withId(String id, String groupId, String artifactId, String version, String scope)
public static Dependency withId(String id, String groupId, String artifactId, String version)
public static Dependency withId(String id, String groupId, String artifactId)
public static Dependency withId(String id, String scope)
public static Dependency withId(String id)
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.