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 classDependency.Builder<B extends Dependency.Builder<B>>Builder for a dependency.static final classDefine 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.Builderwith the state of the specifiedDependency.The artifact ID of the dependency.The classifier of this dependency.Theexclusionsto apply.The group ID of the dependency.getScope()Thescopeof the dependency.getType()The type of the dependency.TheVersionReferenceof the dependency.static Dependency.Builder<?>withCoordinates(String groupId, String artifactId) Initialize a new dependencyDependency.Builderwith the specified coordinates.
-
Constructor Details
-
Dependency
-
-
Method Details
-
withCoordinates
Initialize a new dependencyDependency.Builderwith 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.Builderwith 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
TheVersionReferenceof the dependency. May benullfor a dependency whose version is expected to be provided by dependency management.- Returns:
- the version reference or
null
-
getScope
Thescopeof 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 benullto indicate that the default type should be used (i.e.jar).- Returns:
- the type or
null
-
getExclusions
Theexclusionsto apply.- Returns:
- the exclusions to apply
-