Merge branch '1.2.x'
commit
47576354f7
@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.JavaPlugin
|
||||
import org.springframework.boot.gradle.agent.AgentPluginFeatures
|
||||
import org.springframework.boot.gradle.dependencymanagement.DependencyManagementPluginFeatures
|
||||
import org.springframework.boot.gradle.repackage.RepackagePluginFeatures
|
||||
import org.springframework.boot.gradle.run.RunPluginFeatures
|
||||
|
||||
/**
|
||||
* Gradle 'Spring Boot' {@link Plugin}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
class SpringBootPlugin implements Plugin<Project> {
|
||||
|
||||
@Override
|
||||
void apply(Project project) {
|
||||
project.getExtensions().create("springBoot", SpringBootPluginExtension)
|
||||
|
||||
project.getPlugins().apply(JavaPlugin)
|
||||
|
||||
new AgentPluginFeatures().apply(project)
|
||||
new RepackagePluginFeatures().apply(project)
|
||||
new RunPluginFeatures().apply(project)
|
||||
new DependencyManagementPluginFeatures().apply(project)
|
||||
|
||||
useUtf8Encoding(project)
|
||||
}
|
||||
|
||||
private useUtf8Encoding(Project project) {
|
||||
project.tasks.withType(org.gradle.api.tasks.compile.JavaCompile).all {
|
||||
it.doFirst {
|
||||
if(!it.options.encoding) {
|
||||
it.options.encoding = 'UTF-8'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.boot.loader.tools.Layout;
|
||||
import org.springframework.boot.loader.tools.Layouts;
|
||||
|
||||
/**
|
||||
* Gradle DSL Extension for 'Spring Boot'. Most of the time Spring Boot can guess the
|
||||
* settings in this extension, but occasionally you might need to explicitly set one
|
||||
* or two of them. E.g.
|
||||
*
|
||||
* <pre>
|
||||
* apply plugin: "spring-boot"
|
||||
* springBoot {
|
||||
* mainClass = 'org.demo.Application'
|
||||
* layout = 'ZIP'
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class SpringBootPluginExtension {
|
||||
|
||||
enum LayoutType {
|
||||
|
||||
JAR(new Layouts.Jar()),
|
||||
|
||||
WAR(new Layouts.War()),
|
||||
|
||||
ZIP(new Layouts.Expanded()),
|
||||
|
||||
DIR(new Layouts.Expanded()),
|
||||
|
||||
MODULE(new Layouts.Module()),
|
||||
|
||||
NONE(new Layouts.None());
|
||||
|
||||
Layout layout;
|
||||
|
||||
private LayoutType(Layout layout) {
|
||||
this.layout = layout;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The main class that should be run. Instead of setting this explicitly you can use the
|
||||
* 'mainClassName' of the project or the 'main' of the 'run' task. If not specified the
|
||||
* value from the MANIFEST will be used, or if no manifest entry is the archive will be
|
||||
* searched for a suitable class.
|
||||
*/
|
||||
String mainClass
|
||||
|
||||
/**
|
||||
* The classifier (file name part before the extension). Instead of setting this explicitly
|
||||
* you can use the 'classifier' property of the 'bootRepackage' task. If not specified the archive
|
||||
* will be replaced instead of renamed.
|
||||
*/
|
||||
String classifier
|
||||
|
||||
/**
|
||||
* The name of the ivy configuration name to treat as 'provided' (when packaging
|
||||
* those dependencies in a separate path). If not specified 'providedRuntime' will
|
||||
* be used.
|
||||
*/
|
||||
String providedConfiguration
|
||||
|
||||
/**
|
||||
* The name of the custom configuration to use.
|
||||
*/
|
||||
String customConfiguration
|
||||
|
||||
/**
|
||||
* If the original source archive should be backed-up before being repackaged.
|
||||
*/
|
||||
boolean backupSource = true;
|
||||
|
||||
/**
|
||||
* The layout of the archive if it can't be derived from the file extension.
|
||||
* Valid values are JAR, WAR, ZIP, DIR (for exploded zip file). ZIP and DIR
|
||||
* are actually synonymous, and should be used if there is no MANIFEST.MF
|
||||
* available, or if you want the MANIFEST.MF 'Main-Class' to be
|
||||
* PropertiesLauncher. Gradle will coerce literal String values to the
|
||||
* correct type.
|
||||
*/
|
||||
LayoutType layout;
|
||||
|
||||
/**
|
||||
* Convenience method for use in a custom task.
|
||||
* @return the Layout to use or null if not explicitly set
|
||||
*/
|
||||
Layout convertLayout() {
|
||||
(layout == null ? null : layout.layout)
|
||||
}
|
||||
|
||||
/**
|
||||
* Libraries that must be unpacked from fat jars in order to run. Use Strings in the
|
||||
* form {@literal groupId:artifactId}.
|
||||
*/
|
||||
Set<String> requiresUnpack;
|
||||
|
||||
/**
|
||||
* Location of an agent jar to attach to the VM when running the application with runJar task.
|
||||
*/
|
||||
File agent;
|
||||
|
||||
/**
|
||||
* Flag to indicate that the agent requires -noverify (and the plugin will refuse to start if it is not set)
|
||||
*/
|
||||
Boolean noverify;
|
||||
|
||||
/**
|
||||
* If exclude rules should be applied to dependencies based on the spring-dependencies-bom
|
||||
*/
|
||||
boolean applyExcludeRules = true;
|
||||
|
||||
/**
|
||||
* If a fully executable jar (for *nix machines) should be generated by prepending a
|
||||
* launch script to the jar.
|
||||
*/
|
||||
boolean executable = false;
|
||||
|
||||
/**
|
||||
* The embedded launch script to prepend to the front of the jar if it is fully
|
||||
* executable. If not specified the 'Spring Boot' default script will be used.
|
||||
*/
|
||||
File embeddedLaunchScript;
|
||||
|
||||
/**
|
||||
* Properties that should be expanded in the embedded launch script.
|
||||
*/
|
||||
Map<String,String> embeddedLaunchScriptProperties;
|
||||
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle.dependencymanagement;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.springframework.boot.gradle.PluginFeatures;
|
||||
|
||||
import io.spring.gradle.dependencymanagement.DependencyManagementExtension
|
||||
import io.spring.gradle.dependencymanagement.DependencyManagementPlugin
|
||||
|
||||
/**
|
||||
* {@link PluginFeatures} to configure dependency management
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
class DependencyManagementPluginFeatures implements PluginFeatures {
|
||||
|
||||
@Override
|
||||
void apply(Project project) {
|
||||
project.plugins.apply(DependencyManagementPlugin)
|
||||
DependencyManagementExtension dependencyManagement = project.extensions
|
||||
.findByType(DependencyManagementExtension)
|
||||
dependencyManagement.imports {
|
||||
def version = DependencyManagementPluginFeatures.class.getPackage().implementationVersion
|
||||
mavenBom "org.springframework.boot:spring-boot-starter-parent:$version"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle;
|
||||
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.Task;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.tasks.compile.JavaCompile;
|
||||
import org.springframework.boot.gradle.agent.AgentPluginFeatures;
|
||||
import org.springframework.boot.gradle.dependencymanagement.DependencyManagementPluginFeatures;
|
||||
import org.springframework.boot.gradle.repackage.RepackagePluginFeatures;
|
||||
import org.springframework.boot.gradle.run.RunPluginFeatures;
|
||||
|
||||
/**
|
||||
* Gradle 'Spring Boot' {@link Plugin}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
class SpringBootPlugin implements Plugin<Project> {
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
project.getExtensions().create("springBoot", SpringBootPluginExtension.class);
|
||||
project.getPlugins().apply(JavaPlugin.class);
|
||||
new AgentPluginFeatures().apply(project);
|
||||
new RepackagePluginFeatures().apply(project);
|
||||
new RunPluginFeatures().apply(project);
|
||||
new DependencyManagementPluginFeatures().apply(project);
|
||||
project.getTasks().withType(JavaCompile.class).all(new SetUtf8EncodingAction());
|
||||
}
|
||||
|
||||
private static class SetUtf8EncodingAction implements Action<JavaCompile> {
|
||||
|
||||
@Override
|
||||
public void execute(final JavaCompile compile) {
|
||||
compile.doFirst(new Action<Task>() {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void execute(Task t) {
|
||||
if (compile.getOptions().getEncoding() == null) {
|
||||
compile.getOptions().setEncoding("UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,263 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.boot.loader.tools.Layout;
|
||||
import org.springframework.boot.loader.tools.Layouts;
|
||||
|
||||
/**
|
||||
* Gradle DSL Extension for 'Spring Boot'. Most of the time Spring Boot can guess the
|
||||
* settings in this extension, but occasionally you might need to explicitly set one or
|
||||
* two of them. E.g.
|
||||
*
|
||||
* <pre>
|
||||
* apply plugin: "spring-boot"
|
||||
* springBoot {
|
||||
* mainClass = 'org.demo.Application'
|
||||
* layout = 'ZIP'
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class SpringBootPluginExtension {
|
||||
|
||||
/**
|
||||
* The main class that should be run. Instead of setting this explicitly you can use
|
||||
* the 'mainClassName' of the project or the 'main' of the 'run' task. If not
|
||||
* specified the value from the MANIFEST will be used, or if no manifest entry is the
|
||||
* archive will be searched for a suitable class.
|
||||
*/
|
||||
String mainClass;
|
||||
|
||||
/**
|
||||
* The classifier (file name part before the extension). Instead of setting this
|
||||
* explicitly you can use the 'classifier' property of the 'bootRepackage' task. If
|
||||
* not specified the archive will be replaced instead of renamed.
|
||||
*/
|
||||
String classifier;
|
||||
|
||||
/**
|
||||
* The name of the ivy configuration name to treat as 'provided' (when packaging those
|
||||
* dependencies in a separate path). If not specified 'providedRuntime' will be used.
|
||||
*/
|
||||
String providedConfiguration;
|
||||
|
||||
/**
|
||||
* The name of the custom configuration to use.
|
||||
*/
|
||||
String customConfiguration;
|
||||
|
||||
/**
|
||||
* If the original source archive should be backed-up before being repackaged.
|
||||
*/
|
||||
boolean backupSource = true;
|
||||
|
||||
/**
|
||||
* The layout of the archive if it can't be derived from the file extension. Valid
|
||||
* values are JAR, WAR, ZIP, DIR (for exploded zip file). ZIP and DIR are actually
|
||||
* synonymous, and should be used if there is no MANIFEST.MF available, or if you want
|
||||
* the MANIFEST.MF 'Main-Class' to be PropertiesLauncher. Gradle will coerce literal
|
||||
* String values to the correct type.
|
||||
*/
|
||||
LayoutType layout;
|
||||
|
||||
/**
|
||||
* Libraries that must be unpacked from fat jars in order to run. Use Strings in the
|
||||
* form {@literal groupId:artifactId}.
|
||||
*/
|
||||
Set<String> requiresUnpack;
|
||||
|
||||
/**
|
||||
* Location of an agent jar to attach to the VM when running the application with
|
||||
* runJar task.
|
||||
*/
|
||||
File agent;
|
||||
|
||||
/**
|
||||
* Flag to indicate that the agent requires -noverify (and the plugin will refuse to
|
||||
* start if it is not set).
|
||||
*/
|
||||
Boolean noverify;
|
||||
|
||||
/**
|
||||
* If exclude rules should be applied to dependencies based on the
|
||||
* spring-dependencies-bom.
|
||||
*/
|
||||
boolean applyExcludeRules = true;
|
||||
|
||||
/**
|
||||
* If a fully executable jar (for *nix machines) should be generated by prepending a
|
||||
* launch script to the jar.
|
||||
*/
|
||||
boolean executable = false;
|
||||
|
||||
/**
|
||||
* The embedded launch script to prepend to the front of the jar if it is fully
|
||||
* executable. If not specified the 'Spring Boot' default script will be used.
|
||||
*/
|
||||
File embeddedLaunchScript;
|
||||
|
||||
/**
|
||||
* Properties that should be expanded in the embedded launch script.
|
||||
*/
|
||||
Map<String, String> embeddedLaunchScriptProperties;
|
||||
|
||||
/**
|
||||
* Convenience method for use in a custom task.
|
||||
* @return the Layout to use or null if not explicitly set
|
||||
*/
|
||||
public Layout convertLayout() {
|
||||
return (this.layout == null ? null : this.layout.layout);
|
||||
}
|
||||
|
||||
public String getMainClass() {
|
||||
return this.mainClass;
|
||||
}
|
||||
|
||||
public void setMainClass(String mainClass) {
|
||||
this.mainClass = mainClass;
|
||||
}
|
||||
|
||||
public String getClassifier() {
|
||||
return this.classifier;
|
||||
}
|
||||
|
||||
public void setClassifier(String classifier) {
|
||||
this.classifier = classifier;
|
||||
}
|
||||
|
||||
public String getProvidedConfiguration() {
|
||||
return this.providedConfiguration;
|
||||
}
|
||||
|
||||
public void setProvidedConfiguration(String providedConfiguration) {
|
||||
this.providedConfiguration = providedConfiguration;
|
||||
}
|
||||
|
||||
public String getCustomConfiguration() {
|
||||
return this.customConfiguration;
|
||||
}
|
||||
|
||||
public void setCustomConfiguration(String customConfiguration) {
|
||||
this.customConfiguration = customConfiguration;
|
||||
}
|
||||
|
||||
public boolean isBackupSource() {
|
||||
return this.backupSource;
|
||||
}
|
||||
|
||||
public void setBackupSource(boolean backupSource) {
|
||||
this.backupSource = backupSource;
|
||||
}
|
||||
|
||||
public LayoutType getLayout() {
|
||||
return this.layout;
|
||||
}
|
||||
|
||||
public void setLayout(LayoutType layout) {
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
public Set<String> getRequiresUnpack() {
|
||||
return this.requiresUnpack;
|
||||
}
|
||||
|
||||
public void setRequiresUnpack(Set<String> requiresUnpack) {
|
||||
this.requiresUnpack = requiresUnpack;
|
||||
}
|
||||
|
||||
public File getAgent() {
|
||||
return this.agent;
|
||||
}
|
||||
|
||||
public void setAgent(File agent) {
|
||||
this.agent = agent;
|
||||
}
|
||||
|
||||
public Boolean getNoverify() {
|
||||
return this.noverify;
|
||||
}
|
||||
|
||||
public void setNoverify(Boolean noverify) {
|
||||
this.noverify = noverify;
|
||||
}
|
||||
|
||||
public boolean isApplyExcludeRules() {
|
||||
return this.applyExcludeRules;
|
||||
}
|
||||
|
||||
public void setApplyExcludeRules(boolean applyExcludeRules) {
|
||||
this.applyExcludeRules = applyExcludeRules;
|
||||
}
|
||||
|
||||
public boolean isExecutable() {
|
||||
return this.executable;
|
||||
}
|
||||
|
||||
public void setExecutable(boolean executable) {
|
||||
this.executable = executable;
|
||||
}
|
||||
|
||||
public File getEmbeddedLaunchScript() {
|
||||
return this.embeddedLaunchScript;
|
||||
}
|
||||
|
||||
public void setEmbeddedLaunchScript(File embeddedLaunchScript) {
|
||||
this.embeddedLaunchScript = embeddedLaunchScript;
|
||||
}
|
||||
|
||||
public Map<String, String> getEmbeddedLaunchScriptProperties() {
|
||||
return this.embeddedLaunchScriptProperties;
|
||||
}
|
||||
|
||||
public void setEmbeddedLaunchScriptProperties(
|
||||
Map<String, String> embeddedLaunchScriptProperties) {
|
||||
this.embeddedLaunchScriptProperties = embeddedLaunchScriptProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout Types.
|
||||
*/
|
||||
enum LayoutType {
|
||||
|
||||
JAR(new Layouts.Jar()),
|
||||
|
||||
WAR(new Layouts.War()),
|
||||
|
||||
ZIP(new Layouts.Expanded()),
|
||||
|
||||
DIR(new Layouts.Expanded()),
|
||||
|
||||
MODULE(new Layouts.Module()),
|
||||
|
||||
NONE(new Layouts.None());
|
||||
|
||||
Layout layout;
|
||||
|
||||
LayoutType(Layout layout) {
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.gradle.dependencymanagement;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.springframework.boot.gradle.PluginFeatures;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import groovy.lang.Closure;
|
||||
import io.spring.gradle.dependencymanagement.DependencyManagementExtension;
|
||||
import io.spring.gradle.dependencymanagement.DependencyManagementPlugin;
|
||||
|
||||
/**
|
||||
* {@link PluginFeatures} to configure dependency management.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Phillip Webb
|
||||
* @since 1.3.0
|
||||
*/
|
||||
public class DependencyManagementPluginFeatures implements PluginFeatures {
|
||||
|
||||
private static final String SPRING_BOOT_VERSION = DependencyManagementPluginFeatures.class
|
||||
.getPackage().getImplementationVersion();
|
||||
|
||||
private static final String SPRING_BOOT_BOM = "org.springframework.boot:spring-boot-starter-parent:"
|
||||
+ SPRING_BOOT_VERSION;
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
project.getPlugins().apply(DependencyManagementPlugin.class);
|
||||
DependencyManagementExtension dependencyManagement = project.getExtensions()
|
||||
.findByType(DependencyManagementExtension.class);
|
||||
dependencyManagement.imports(new Closure<Void>(this) {
|
||||
|
||||
@Override
|
||||
public Void call(Object... args) {
|
||||
try {
|
||||
ReflectionUtils.findMethod(getDelegate().getClass(), "mavenBom",
|
||||
String.class).invoke(getDelegate(), SPRING_BOOT_BOM);
|
||||
return null;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue