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.@Nullable StringThe classifier of this dependency.Theexclusionsto apply.The group ID of the dependency.@Nullable DependencyScopegetScope()Thescopeof the dependency.@Nullable StringgetType()The type of the dependency.@Nullable VersionReferenceTheVersionReferenceof 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
-
getArtifactId
-
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
-
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
-