diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/agent/AgentTasksEnhancer.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/agent/AgentTasksEnhancer.java
deleted file mode 100644
index 0ffdca2cf1..0000000000
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/agent/AgentTasksEnhancer.java
+++ /dev/null
@@ -1,125 +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.agent;
-
-import java.io.File;
-import java.net.URISyntaxException;
-import java.security.CodeSource;
-
-import org.gradle.api.Action;
-import org.gradle.api.Project;
-import org.gradle.api.Task;
-import org.gradle.api.tasks.JavaExec;
-import org.springframework.boot.gradle.SpringBootPluginExtension;
-
-/**
- * Add a java agent to the "run" task if configured. You can add an agent in 3 ways (4 if
- * you want to use native gradle features as well):
- *
- *
- *
Use "-Prun.agent=[path-to-jar]" on the gradle command line
- *
Add an "agent" property (jar file) to the "springBoot" extension in build.gradle
- *
As a special case springloaded is detected as a build script dependency
- *
- *
- * @author Dave Syer
- * @author Phillip Webb
- */
-public class AgentTasksEnhancer implements Action {
-
- private static final String SPRING_LOADED_AGENT_CLASSNAME = "org.springsource.loaded.agent.SpringLoadedAgent";
-
- private File agent;
-
- private Boolean noverify;
-
- @Override
- public void execute(Project project) {
- setup(project);
- if (this.agent != null) {
- for (Task task : project.getTasks()) {
- addAgent(project, task);
- }
- }
- }
-
- private void setup(Project project) {
- project.getLogger().info("Configuring agent");
- SpringBootPluginExtension extension = project.getExtensions().getByType(
- SpringBootPluginExtension.class);
- this.noverify = extension.getNoverify();
- this.agent = getAgent(project, extension);
- if (this.agent == null) {
- this.agent = getSpringLoadedAgent();
- if (this.noverify == null) {
- this.noverify = true;
- }
- }
- project.getLogger().debug("Agent: " + this.agent);
- }
-
- private File getAgent(Project project, SpringBootPluginExtension extension) {
- if (project.hasProperty("run.agent")) {
- return project.file(project.property("run.agent"));
- }
- return extension.getAgent();
- }
-
- private File getSpringLoadedAgent() {
- try {
- Class> loaded = Class.forName(SPRING_LOADED_AGENT_CLASSNAME);
- if (loaded != null) {
- CodeSource source = loaded.getProtectionDomain().getCodeSource();
- if (source != null) {
- try {
- return new File(source.getLocation().toURI());
- }
- catch (URISyntaxException ex) {
- return new File(source.getLocation().getPath());
- }
- }
- }
- }
- catch (ClassNotFoundException ex) {
- // ignore;
- }
- return null;
- }
-
- private void addAgent(Project project, Task task) {
- if (task instanceof JavaExec) {
- addAgent(project, (JavaExec) task);
- }
- }
-
- private void addAgent(Project project, JavaExec exec) {
- project.getLogger().debug("Attaching to: " + exec);
- if (this.agent != null) {
- project.getLogger().info("Attaching agent: " + this.agent);
- exec.jvmArgs("-javaagent:" + this.agent.getAbsolutePath());
- if (this.noverify != null && this.noverify) {
- exec.jvmArgs("-noverify");
- }
- Iterable> defaultJvmArgs = exec.getConventionMapping().getConventionValue(
- null, "jvmArgs", false);
- if (defaultJvmArgs != null) {
- exec.jvmArgs(defaultJvmArgs);
- }
- }
- }
-
-}
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/exclude/ApplyExcludeRules.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/exclude/ApplyExcludeRules.java
deleted file mode 100644
index b12e2cb549..0000000000
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/exclude/ApplyExcludeRules.java
+++ /dev/null
@@ -1,115 +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.exclude;
-
-import org.gradle.api.Action;
-import org.gradle.api.Project;
-import org.gradle.api.artifacts.Configuration;
-import org.gradle.api.artifacts.Dependency;
-import org.gradle.api.artifacts.ModuleDependency;
-import org.gradle.api.artifacts.ResolvableDependencies;
-import org.gradle.api.internal.artifacts.DefaultExcludeRule;
-import org.gradle.api.logging.Logger;
-import org.springframework.boot.dependency.tools.Dependency.Exclusion;
-import org.springframework.boot.dependency.tools.ManagedDependencies;
-import org.springframework.boot.gradle.VersionManagedDependencies;
-
-/**
- * {@link Action} to apply exclude rules.
- *
- * @author Phillip Webb
- */
-public class ApplyExcludeRules implements Action {
-
- private final Logger logger;
-
- private final VersionManagedDependencies versionManagedDependencies;
-
- public ApplyExcludeRules(Project project) {
- this.logger = project.getLogger();
- this.versionManagedDependencies = new VersionManagedDependencies(project);
- }
-
- @Override
- public void execute(Configuration configuration) {
- if (!VersionManagedDependencies.CONFIGURATION.equals(configuration.getName())) {
- configuration.getIncoming().beforeResolve(
- new Action() {
- @Override
- public void execute(ResolvableDependencies resolvableDependencies) {
- resolvableDependencies.getDependencies().all(
- new Action() {
- @Override
- public void execute(Dependency dependency) {
- applyExcludeRules(dependency);
- }
- });
- }
- });
- }
- }
-
- private void applyExcludeRules(Dependency dependency) {
- if (dependency instanceof ModuleDependency) {
- applyExcludeRules((ModuleDependency) dependency);
- }
- }
-
- private void applyExcludeRules(ModuleDependency dependency) {
- ManagedDependencies managedDependencies = versionManagedDependencies
- .getManagedDependencies();
- // flat directory repositories do not have groups
- if (dependency.getGroup() != null) {
- org.springframework.boot.dependency.tools.Dependency managedDependency = managedDependencies
- .find(dependency.getGroup(), dependency.getName());
- if (managedDependency != null) {
- for (Exclusion exclusion : managedDependency.getExclusions()) {
- addExcludeRule(dependency, exclusion);
- }
- addImplicitExcludeRules(dependency);
- return;
- }
- }
- logger.debug("No exclusions rules applied for non-managed dependency "
- + dependency);
- }
-
- private void addExcludeRule(ModuleDependency dependency, Exclusion exclusion) {
- logger.info("Adding managed exclusion rule " + exclusion + " to " + dependency);
- DefaultExcludeRule rule = new DefaultExcludeRule(exclusion.getGroupId(),
- exclusion.getArtifactId());
- dependency.getExcludeRules().add(rule);
- }
-
- private void addImplicitExcludeRules(ModuleDependency dependency) {
- if (isStarter(dependency)) {
- logger.info("Adding implicit managed exclusion rules to starter "
- + dependency);
- dependency.getExcludeRules().add(
- new DefaultExcludeRule("commons-logging", "commons-logging"));
- dependency.getExcludeRules().add(
- new DefaultExcludeRule("commons-logging", "commons-logging-api"));
- }
- }
-
- private boolean isStarter(ModuleDependency dependency) {
- return (dependency.getGroup() != null
- && dependency.getGroup().equals("org.springframework.boot") && dependency
- .getName().startsWith("spring-boot-starter"));
- }
-
-}
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/exclude/ExcludePluginFeatures.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/exclude/ExcludePluginFeatures.java
deleted file mode 100644
index 26510ff488..0000000000
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/exclude/ExcludePluginFeatures.java
+++ /dev/null
@@ -1,39 +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.exclude;
-
-import org.gradle.api.Project;
-import org.springframework.boot.gradle.PluginFeatures;
-import org.springframework.boot.gradle.SpringBootPluginExtension;
-
-/**
- * {@link PluginFeatures} to apply exclusion rules.
- *
- * @author Phillip Webb
- */
-public class ExcludePluginFeatures implements PluginFeatures {
-
- @Override
- public void apply(Project project) {
- SpringBootPluginExtension extension = project.getExtensions().getByType(
- SpringBootPluginExtension.class);
- if (extension.isApplyExcludeRules()) {
- project.getConfigurations().all(new ApplyExcludeRules(project));
- }
- }
-
-}
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java
deleted file mode 100644
index 99887e68c2..0000000000
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java
+++ /dev/null
@@ -1,242 +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.repackage;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.gradle.api.Project;
-import org.gradle.api.artifacts.Configuration;
-import org.gradle.api.artifacts.Dependency;
-import org.gradle.api.artifacts.FileCollectionDependency;
-import org.gradle.api.artifacts.ModuleVersionIdentifier;
-import org.gradle.api.artifacts.ProjectDependency;
-import org.gradle.api.artifacts.ResolvedArtifact;
-import org.springframework.boot.gradle.SpringBootPluginExtension;
-import org.springframework.boot.loader.tools.Libraries;
-import org.springframework.boot.loader.tools.Library;
-import org.springframework.boot.loader.tools.LibraryCallback;
-import org.springframework.boot.loader.tools.LibraryScope;
-
-/**
- * Expose Gradle {@link Configuration}s as {@link Libraries}.
- *
- * @author Phillip Webb
- * @author Andy Wilkinson
- */
-class ProjectLibraries implements Libraries {
-
- private final Project project;
-
- private final SpringBootPluginExtension extension;
-
- private String providedConfigurationName = "providedRuntime";
-
- private String customConfigurationName = null;
-
- /**
- * Create a new {@link ProjectLibraries} instance of the specified {@link Project}.
- * @param project the gradle project
- * @param extension the extension
- */
- public ProjectLibraries(Project project, SpringBootPluginExtension extension) {
- this.project = project;
- this.extension = extension;
- }
-
- /**
- * Set the name of the provided configuration. Defaults to 'providedRuntime'.
- * @param providedConfigurationName the providedConfigurationName to set
- */
- public void setProvidedConfigurationName(String providedConfigurationName) {
- this.providedConfigurationName = providedConfigurationName;
- }
-
- public void setCustomConfigurationName(String customConfigurationName) {
- this.customConfigurationName = customConfigurationName;
- }
-
- @Override
- public void doWithLibraries(LibraryCallback callback) throws IOException {
- Set custom = getLibraries(this.customConfigurationName,
- LibraryScope.CUSTOM);
- if (custom != null) {
- libraries(custom, callback);
- }
- else {
- Set compile = getLibraries("compile", LibraryScope.COMPILE);
- Set runtime = getLibraries("runtime", LibraryScope.RUNTIME);
- runtime = minus(runtime, compile);
- Set provided = getLibraries(this.providedConfigurationName,
- LibraryScope.PROVIDED);
- if (provided != null) {
- compile = minus(compile, provided);
- runtime = minus(runtime, provided);
- }
- libraries(compile, callback);
- libraries(runtime, callback);
- libraries(provided, callback);
- }
- }
-
- private Set getLibraries(String configurationName, LibraryScope scope) {
- Configuration configuration = (configurationName == null ? null : this.project
- .getConfigurations().findByName(configurationName));
- if (configuration == null) {
- return null;
- }
- Set libraries = new LinkedHashSet();
- for (ResolvedArtifact artifact : configuration.getResolvedConfiguration()
- .getResolvedArtifacts()) {
- libraries.add(new ResolvedArtifactLibrary(artifact, scope));
- }
- libraries.addAll(getLibrariesForFileDependencies(configuration, scope));
- return libraries;
- }
-
- private Set getLibrariesForFileDependencies(
- Configuration configuration, LibraryScope scope) {
- Set libraries = new LinkedHashSet();
- for (Dependency dependency : configuration.getIncoming().getDependencies()) {
- if (dependency instanceof FileCollectionDependency) {
- FileCollectionDependency fileDependency = (FileCollectionDependency) dependency;
- for (File file : fileDependency.resolve()) {
- libraries.add(new GradleLibrary(fileDependency.getGroup(), file,
- scope));
- }
- }
- else if (dependency instanceof ProjectDependency) {
- ProjectDependency projectDependency = (ProjectDependency) dependency;
- libraries.addAll(getLibrariesForFileDependencies(
- projectDependency.getProjectConfiguration(), scope));
- }
- }
- return libraries;
- }
-
- private Set minus(Set source,
- Set toRemove) {
- if (source == null || toRemove == null) {
- return source;
- }
- Set filesToRemove = new HashSet();
- for (GradleLibrary library : toRemove) {
- filesToRemove.add(library.getFile());
- }
- Set result = new LinkedHashSet();
- for (GradleLibrary library : source) {
- if (!filesToRemove.contains(library.getFile())) {
- result.add(library);
- }
- }
- return result;
- }
-
- private void libraries(Set libraries, LibraryCallback callback)
- throws IOException {
- if (libraries != null) {
- Set duplicates = getDuplicates(libraries);
- for (GradleLibrary library : libraries) {
- library.setIncludeGroupName(duplicates.contains(library.getName()));
- callback.library(library);
- }
- }
- }
-
- private Set getDuplicates(Set libraries) {
- Set duplicates = new HashSet();
- Set seen = new HashSet();
- for (GradleLibrary library : libraries) {
- if (library.getFile() != null && !seen.add(library.getFile().getName())) {
- duplicates.add(library.getFile().getName());
- }
- }
- return duplicates;
- }
-
- private class GradleLibrary extends Library {
-
- private final String group;
-
- private boolean includeGroupName;
-
- public GradleLibrary(String group, File file, LibraryScope scope) {
- super(file, scope);
- this.group = group;
- }
-
- public void setIncludeGroupName(boolean includeGroupName) {
- this.includeGroupName = includeGroupName;
- }
-
- @Override
- public String getName() {
- String name = super.getName();
- if (this.includeGroupName && this.group != null) {
- name = this.group + "-" + name;
- }
- return name;
- }
-
- @Override
- public int hashCode() {
- return getFile().hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof GradleLibrary) {
- return getFile().equals(((GradleLibrary) obj).getFile());
- }
- return false;
- }
-
- @Override
- public String toString() {
- return getFile().getAbsolutePath();
- }
- }
-
- /**
- * Adapts a {@link ResolvedArtifact} to a {@link Library}.
- */
- private class ResolvedArtifactLibrary extends GradleLibrary {
-
- private final ResolvedArtifact artifact;
-
- public ResolvedArtifactLibrary(ResolvedArtifact artifact, LibraryScope scope) {
- super(artifact.getModuleVersion().getId().getGroup(), artifact.getFile(),
- scope);
- this.artifact = artifact;
- }
-
- @Override
- public boolean isUnpackRequired() {
- if (ProjectLibraries.this.extension.getRequiresUnpack() != null) {
- ModuleVersionIdentifier id = this.artifact.getModuleVersion().getId();
- return ProjectLibraries.this.extension.getRequiresUnpack().contains(
- id.getGroup() + ":" + id.getName());
- }
- return false;
- }
-
- }
-
-}
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java
deleted file mode 100644
index c4679f64d0..0000000000
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java
+++ /dev/null
@@ -1,161 +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.repackage;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.gradle.api.Action;
-import org.gradle.api.Project;
-import org.gradle.api.Task;
-import org.gradle.api.artifacts.Configuration;
-import org.gradle.api.artifacts.Dependency;
-import org.gradle.api.logging.Logger;
-import org.gradle.api.plugins.BasePlugin;
-import org.gradle.api.plugins.JavaPlugin;
-import org.gradle.api.tasks.TaskDependency;
-import org.gradle.api.tasks.bundling.Jar;
-import org.springframework.boot.gradle.PluginFeatures;
-import org.springframework.boot.gradle.SpringBootPluginExtension;
-import org.springframework.boot.loader.tools.Library;
-import org.springframework.boot.loader.tools.LibraryCallback;
-import org.springframework.util.StringUtils;
-
-/**
- * {@link PluginFeatures} to add repackage support.
- *
- * @author Phillip Webb
- * @author Dave Syer
- * @author Andy Wilkinson
- */
-public class RepackagePluginFeatures implements PluginFeatures {
-
- public static final String REPACKAGE_TASK_NAME = "bootRepackage";
-
- @Override
- public void apply(Project project) {
- addRepackageTask(project);
- registerRepackageTaskProperty(project);
- }
-
- private void addRepackageTask(Project project) {
- RepackageTask task = project.getTasks().create(REPACKAGE_TASK_NAME,
- RepackageTask.class);
- task.setDescription("Repackage existing JAR and WAR "
- + "archives so that they can be executed from the command "
- + "line using 'java -jar'");
- task.setGroup(BasePlugin.BUILD_GROUP);
- Configuration runtimeConfiguration = project.getConfigurations().getByName(
- JavaPlugin.RUNTIME_CONFIGURATION_NAME);
- TaskDependency runtimeProjectDependencyJarTasks = runtimeConfiguration
- .getTaskDependencyFromProjectDependency(true, JavaPlugin.JAR_TASK_NAME);
- task.dependsOn(
- project.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION)
- .getAllArtifacts().getBuildDependencies(),
- runtimeProjectDependencyJarTasks);
- registerOutput(project, task);
- ensureTaskRunsOnAssembly(project, task);
- }
-
- private void registerOutput(Project project, final RepackageTask task) {
- project.afterEvaluate(new Action() {
- @Override
- public void execute(Project project) {
- project.getTasks().withType(Jar.class,
- new RegisterInputsOutputsAction(task));
- Object withJar = task.getWithJarTask();
- if (withJar != null) {
- task.dependsOn(withJar);
- }
- }
- });
- }
-
- private void ensureTaskRunsOnAssembly(Project project, Task task) {
- project.getTasks().getByName(BasePlugin.ASSEMBLE_TASK_NAME).dependsOn(task);
- }
-
- /**
- * Register BootRepackage so that we can use task {@code foo(type: BootRepackage)}.
- */
- private void registerRepackageTaskProperty(Project project) {
- project.getExtensions().getExtraProperties()
- .set("BootRepackage", RepackageTask.class);
- }
-
- /**
- * Register task input/outputs when classifiers are used
- */
- private static class RegisterInputsOutputsAction implements Action {
-
- private final RepackageTask task;
-
- private final Project project;
-
- public RegisterInputsOutputsAction(RepackageTask task) {
- this.task = task;
- this.project = task.getProject();
- }
-
- @Override
- public void execute(Jar jarTask) {
- if ("".equals(jarTask.getClassifier())) {
- String classifier = this.task.getClassifier();
- if (classifier == null) {
- SpringBootPluginExtension extension = this.project.getExtensions()
- .getByType(SpringBootPluginExtension.class);
- classifier = extension.getClassifier();
- this.task.setClassifier(classifier);
- }
- if (classifier != null) {
- setupInputOutputs(jarTask, classifier);
- }
- }
- }
-
- private void setupInputOutputs(Jar jarTask, String classifier) {
- Logger logger = this.project.getLogger();
- logger.debug("Using classifier: " + classifier + " for task "
- + this.task.getName());
- File inputFile = jarTask.getArchivePath();
- String outputName = inputFile.getName();
- outputName = StringUtils.stripFilenameExtension(outputName) + "-"
- + classifier + "." + StringUtils.getFilenameExtension(outputName);
- File outputFile = new File(inputFile.getParentFile(), outputName);
- this.task.getInputs().file(jarTask);
- addLibraryDependencies(this.task);
- this.task.getOutputs().file(outputFile);
- this.task.setOutputFile(outputFile);
- }
-
- private void addLibraryDependencies(final RepackageTask task) {
- try {
- task.getLibraries().doWithLibraries(new LibraryCallback() {
- @Override
- public void library(Library library) throws IOException {
- task.getInputs().file(library.getFile());
- }
- });
- }
- catch (IOException ex) {
- throw new IllegalStateException(ex);
- }
- }
-
- }
-
-}
diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackageTask.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackageTask.java
deleted file mode 100644
index 932017ba0d..0000000000
--- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackageTask.java
+++ /dev/null
@@ -1,237 +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.repackage;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import org.gradle.api.Action;
-import org.gradle.api.DefaultTask;
-import org.gradle.api.Project;
-import org.gradle.api.tasks.TaskAction;
-import org.gradle.api.tasks.bundling.Jar;
-import org.springframework.boot.gradle.SpringBootPluginExtension;
-import org.springframework.boot.loader.tools.Repackager;
-import org.springframework.util.FileCopyUtils;
-
-/**
- * Repackage task.
- *
- * @author Phillip Webb
- * @author Janne Valkealahti
- * @author Andy Wilkinson
- */
-public class RepackageTask extends DefaultTask {
-
- private static final long FIND_WARNING_TIMEOUT = TimeUnit.SECONDS.toMillis(10);
-
- private String customConfiguration;
-
- private Object withJarTask;
-
- private String mainClass;
-
- private String classifier;
-
- private File outputFile;
-
- public void setCustomConfiguration(String customConfiguration) {
- this.customConfiguration = customConfiguration;
- }
-
- public Object getWithJarTask() {
- return this.withJarTask;
- }
-
- public void setWithJarTask(Object withJarTask) {
- this.withJarTask = withJarTask;
- }
-
- public void setMainClass(String mainClass) {
- this.mainClass = mainClass;
- }
-
- public String getMainClass() {
- return this.mainClass;
- }
-
- public String getClassifier() {
- return this.classifier;
- }
-
- public void setClassifier(String classifier) {
- this.classifier = classifier;
- }
-
- @TaskAction
- public void repackage() {
- Project project = getProject();
- SpringBootPluginExtension extension = project.getExtensions().getByType(
- SpringBootPluginExtension.class);
- ProjectLibraries libraries = getLibraries();
- project.getTasks().withType(Jar.class, new RepackageAction(extension, libraries));
- }
-
- public ProjectLibraries getLibraries() {
- Project project = getProject();
- SpringBootPluginExtension extension = project.getExtensions().getByType(
- SpringBootPluginExtension.class);
- ProjectLibraries libraries = new ProjectLibraries(project, extension);
- if (extension.getProvidedConfiguration() != null) {
- libraries.setProvidedConfigurationName(extension.getProvidedConfiguration());
- }
- if (this.customConfiguration != null) {
- libraries.setCustomConfigurationName(this.customConfiguration);
- }
- else if (extension.getCustomConfiguration() != null) {
- libraries.setCustomConfigurationName(extension.getCustomConfiguration());
- }
- return libraries;
- }
-
- /**
- * Action to repackage JARs.
- */
- private class RepackageAction implements Action {
-
- private final SpringBootPluginExtension extension;
-
- private final ProjectLibraries libraries;
-
- public RepackageAction(SpringBootPluginExtension extension,
- ProjectLibraries libraries) {
- this.extension = extension;
- this.libraries = libraries;
- }
-
- @Override
- public void execute(Jar jarTask) {
- if (!RepackageTask.this.isEnabled()) {
- getLogger().info("Repackage disabled");
- return;
- }
- Object withJarTask = RepackageTask.this.withJarTask;
- if (!isTaskMatch(jarTask, withJarTask)) {
- getLogger().info(
- "Jar task not repackaged (didn't match withJarTask): " + jarTask);
- return;
- }
- File file = jarTask.getArchivePath();
- if (file.exists()) {
- repackage(file);
- }
- }
-
- private boolean isTaskMatch(Jar task, Object withJarTask) {
- if (withJarTask == null) {
- if ("".equals(task.getClassifier())) {
- Set