mirror of
https://gitee.com/dcren/initializr.git
synced 2026-02-25 21:22:58 +08:00
Add dependency builder
This commit adds a builder for Dependency to allow it to be further tuned without having to add an extra constructor.
This commit is contained in:
@@ -45,9 +45,10 @@ public final class MetadataBuildItemMapper {
|
||||
}
|
||||
VersionReference versionReference = (dependency.getVersion() != null)
|
||||
? VersionReference.ofValue(dependency.getVersion()) : null;
|
||||
return new io.spring.initializr.generator.buildsystem.Dependency(
|
||||
dependency.getGroupId(), dependency.getArtifactId(), versionReference,
|
||||
toDependencyScope(dependency.getScope()), dependency.getType());
|
||||
return io.spring.initializr.generator.buildsystem.Dependency
|
||||
.withCoordinates(dependency.getGroupId(), dependency.getArtifactId())
|
||||
.version(versionReference).scope(toDependencyScope(dependency.getScope()))
|
||||
.type(dependency.getType()).build();
|
||||
}
|
||||
|
||||
private static DependencyScope toDependencyScope(String scope) {
|
||||
|
||||
Reference in New Issue
Block a user