|
|
@ -16,13 +16,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.gradle.dependencymanagement;
|
|
|
|
package org.springframework.boot.gradle.dependencymanagement;
|
|
|
|
|
|
|
|
|
|
|
|
import groovy.lang.Closure;
|
|
|
|
|
|
|
|
import io.spring.gradle.dependencymanagement.DependencyManagementExtension;
|
|
|
|
|
|
|
|
import io.spring.gradle.dependencymanagement.DependencyManagementPlugin;
|
|
|
|
import io.spring.gradle.dependencymanagement.DependencyManagementPlugin;
|
|
|
|
|
|
|
|
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension;
|
|
|
|
|
|
|
|
import io.spring.gradle.dependencymanagement.dsl.ImportsHandler;
|
|
|
|
|
|
|
|
import org.gradle.api.Action;
|
|
|
|
import org.gradle.api.Project;
|
|
|
|
import org.gradle.api.Project;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.gradle.PluginFeatures;
|
|
|
|
import org.springframework.boot.gradle.PluginFeatures;
|
|
|
|
import org.springframework.util.ReflectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@link PluginFeatures} to configure dependency management.
|
|
|
|
* {@link PluginFeatures} to configure dependency management.
|
|
|
@ -44,18 +44,11 @@ public class DependencyManagementPluginFeatures implements PluginFeatures {
|
|
|
|
project.getPlugins().apply(DependencyManagementPlugin.class);
|
|
|
|
project.getPlugins().apply(DependencyManagementPlugin.class);
|
|
|
|
DependencyManagementExtension dependencyManagement = project.getExtensions()
|
|
|
|
DependencyManagementExtension dependencyManagement = project.getExtensions()
|
|
|
|
.findByType(DependencyManagementExtension.class);
|
|
|
|
.findByType(DependencyManagementExtension.class);
|
|
|
|
dependencyManagement.imports(new Closure<Void>(this) {
|
|
|
|
dependencyManagement.imports(new Action<ImportsHandler>() {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Void call(Object... args) {
|
|
|
|
public void execute(ImportsHandler importsHandler) {
|
|
|
|
try {
|
|
|
|
importsHandler.mavenBom(SPRING_BOOT_BOM);
|
|
|
|
ReflectionUtils.findMethod(getDelegate().getClass(), "mavenBom",
|
|
|
|
|
|
|
|
String.class).invoke(getDelegate(), SPRING_BOOT_BOM);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex) {
|
|
|
|
|
|
|
|
throw new IllegalStateException(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|