Class Dependency
java.lang.Object
io.spring.initializr.generator.buildsystem.Dependency
- Direct Known Subclasses:
GradleDependency
,MavenDependency
A dependency to be declared in a project's build configuration.
- Author:
- Andy Wilkinson, Stephane Nicoll
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Dependency.Builder<B extends Dependency.Builder<B>>
Builder for a dependency.static final class
Define the reference to a transitive dependency to exclude. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Dependency.Builder<?>
from
(Dependency dependency) Initialize a new dependencyDependency.Builder
with the state of the specifiedDependency
.The artifact ID of the dependency.The classifier of this dependency.Theexclusions
to apply.The group ID of the dependency.getScope()
Thescope
of the dependency.getType()
The type of the dependency.TheVersionReference
of the dependency.static Dependency.Builder<?>
withCoordinates
(String groupId, String artifactId) Initialize a new dependencyDependency.Builder
with the specified coordinates.
-
Constructor Details
-
Dependency
-
-
Method Details
-
withCoordinates
Initialize a new dependencyDependency.Builder
with the specified coordinates.- Parameters:
groupId
- the group ID of the dependencyartifactId
- the artifact ID of the dependency- Returns:
- a new builder
-
from
Initialize a new dependencyDependency.Builder
with the state of the specifiedDependency
.- Parameters:
dependency
- the dependency to use to initialize the builder- Returns:
- a new builder initialized with the same state as the
dependency
-
getGroupId
The group ID of the dependency.- Returns:
- the group ID
-
getArtifactId
The artifact ID of the dependency.- Returns:
- the artifact ID
-
getVersion
TheVersionReference
of the dependency. May benull
for a dependency whose version is expected to be provided by dependency management.- Returns:
- the version reference or
null
-
getScope
Thescope
of the dependency.- Returns:
- the scope
-
getClassifier
The classifier of this dependency. Can benull
- Returns:
- the classifier or
null
-
getType
The type of the dependency. Can benull
to indicate that the default type should be used (i.e.jar
).- Returns:
- the type or
null
-
getExclusions
Theexclusions
to apply.- Returns:
- the exclusions to apply
-