diff --git a/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java b/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java index f1344b2b5c..b117adce2b 100644 --- a/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java +++ b/spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java @@ -30,7 +30,8 @@ import org.springframework.context.annotation.ImportResource; public class SampleParentContextApplication { public static void main(String[] args) throws Exception { - new SpringApplicationBuilder(Parent.class).child(SampleParentContextApplication.class).run(args); + new SpringApplicationBuilder(Parent.class).child( + SampleParentContextApplication.class).run(args); } @EnableAutoConfiguration diff --git a/spring-boot-samples/spring-boot-sample-parent-context/src/test/java/sample/parent/consumer/SampleIntegrationApplicationTests.java b/spring-boot-samples/spring-boot-sample-parent-context/src/test/java/sample/parent/consumer/SampleIntegrationApplicationTests.java index 4d62b22253..42de78b523 100644 --- a/spring-boot-samples/spring-boot-sample-parent-context/src/test/java/sample/parent/consumer/SampleIntegrationApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-parent-context/src/test/java/sample/parent/consumer/SampleIntegrationApplicationTests.java @@ -33,6 +33,7 @@ import org.springframework.util.StreamUtils; import sample.parent.SampleParentContextApplication; import sample.parent.producer.ProducerApplication; + import static org.junit.Assert.assertTrue; /** diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/VersionManagedDependencies.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/VersionManagedDependencies.java index 08d4eed181..51dd654cc7 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/VersionManagedDependencies.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/VersionManagedDependencies.java @@ -31,8 +31,8 @@ import org.springframework.boot.dependency.tools.ManagedDependencies; import org.springframework.boot.dependency.tools.PropertiesFileDependencies; /** - * Utility to provide access to {@link ManagedDependencies} with support for version - * file overrides. + * Utility to provide access to {@link ManagedDependencies} with support for version file + * overrides. * * @author Phillip Webb */ 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 index f1496bb476..216670aeb0 100644 --- 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 @@ -123,7 +123,8 @@ class ProjectLibraries implements Libraries { LibraryCallback callback) throws IOException { if (artifacts != null) { for (ResolvedArtifact artifact : artifacts) { - callback.library(new Library(artifact.getFile(), scope, isUnpackRequired(artifact))); + callback.library(new Library(artifact.getFile(), scope, + isUnpackRequired(artifact))); } } } 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 index 8d8079ae7a..1f5cfe71b2 100644 --- 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 @@ -55,8 +55,9 @@ public class RepackagePluginFeatures implements PluginFeatures { + "archives so that they can be executed from the command " + "line using 'java -jar'"); task.setGroup(BasePlugin.BUILD_GROUP); - task.dependsOn(project.getConfigurations().getByName( - Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts().getBuildDependencies()); + task.dependsOn(project.getConfigurations() + .getByName(Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts() + .getBuildDependencies()); registerOutput(project, task); ensureTaskRunsOnAssembly(project, task); } @@ -68,7 +69,7 @@ public class RepackagePluginFeatures implements PluginFeatures { project.getTasks().withType(Jar.class, new RegisterInputsOutputsAction(task)); Object withJar = task.getWithJarTask(); - if (withJar!=null) { + if (withJar != null) { task.dependsOn(withJar); } } @@ -83,8 +84,8 @@ public class RepackagePluginFeatures implements PluginFeatures { * Register BootRepackage so that we can use task {@code foo(type: BootRepackage)}. */ private void registerRepackageTaskProperty(Project project) { - project.getExtensions().getExtraProperties().set("BootRepackage", - RepackageTask.class); + project.getExtensions().getExtraProperties() + .set("BootRepackage", RepackageTask.class); } /** @@ -135,6 +136,7 @@ public class RepackagePluginFeatures implements PluginFeatures { 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()); } 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 index b1a7653274..3e9271a775 100644 --- 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 @@ -97,7 +97,8 @@ public class RepackageTask extends DefaultTask { } if (this.customConfiguration != null) { libraries.setCustomConfigurationName(this.customConfiguration); - } else if (extension.getCustomConfiguration() != null) { + } + else if (extension.getCustomConfiguration() != null) { libraries.setCustomConfigurationName(extension.getCustomConfiguration()); } return libraries; @@ -180,11 +181,13 @@ public class RepackageTask extends DefaultTask { String mainClass = (String) getProject().property("mainClassName"); if (RepackageTask.this.mainClass != null) { mainClass = RepackageTask.this.mainClass; - } else if (this.extension.getMainClass() != null) { + } + else if (this.extension.getMainClass() != null) { mainClass = this.extension.getMainClass(); - } else if (getProject().getTasks().getByName("run").hasProperty("main")) { - mainClass = (String) getProject().getTasks().getByName("run").property( - "main"); + } + else if (getProject().getTasks().getByName("run").hasProperty("main")) { + mainClass = (String) getProject().getTasks().getByName("run") + .property("main"); } getLogger().info("Setting mainClass: " + mainClass); repackager.setMainClass(mainClass); @@ -205,7 +208,8 @@ public class RepackageTask extends DefaultTask { long startTime = System.currentTimeMillis(); try { return super.findMainMethod(source); - } finally { + } + finally { long duration = System.currentTimeMillis() - startTime; if (duration > FIND_WARNING_TIMEOUT) { getLogger().warn( diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/BootRunTask.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/BootRunTask.java index 5c2c216eb4..104a2aacf1 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/BootRunTask.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/BootRunTask.java @@ -38,8 +38,8 @@ public class BootRunTask extends JavaExec { @Override public void exec() { SourceSet mainSourceSet = SourceSets.findMainSourceSet(getProject()); - final File outputDir = (mainSourceSet == null ? null - : mainSourceSet.getOutput().getResourcesDir()); + final File outputDir = (mainSourceSet == null ? null : mainSourceSet.getOutput() + .getResourcesDir()); final Set resources = new LinkedHashSet(); if (mainSourceSet != null) { resources.addAll(mainSourceSet.getResources().getSrcDirs()); diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/FindMainClassTask.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/FindMainClassTask.java index cef3f86dea..13afcc39a8 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/FindMainClassTask.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/FindMainClassTask.java @@ -1,4 +1,3 @@ - package org.springframework.boot.gradle.run; import java.io.IOException; @@ -41,8 +40,8 @@ public class FindMainClassTask extends DefaultTask { mainClass = bootExtension.getMainClass(); } - ApplicationPluginConvention application = (ApplicationPluginConvention) project.getConvention().getPlugins().get( - "application"); + ApplicationPluginConvention application = (ApplicationPluginConvention) project + .getConvention().getPlugins().get("application"); // Try the Application extension setting if (mainClass == null && application.getMainClassName() != null) { mainClass = application.getMainClassName(); @@ -61,9 +60,11 @@ public class FindMainClassTask extends DefaultTask { "Looking for main in: " + mainSourceSet.getOutput().getClassesDir()); try { - mainClass = MainClassFinder.findSingleMainClass(mainSourceSet.getOutput().getClassesDir()); + mainClass = MainClassFinder.findSingleMainClass(mainSourceSet + .getOutput().getClassesDir()); project.getLogger().info("Computed main class: " + mainClass); - } catch (IOException ex) { + } + catch (IOException ex) { throw new IllegalStateException("Cannot find main class", ex); } } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/RunPluginFeatures.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/RunPluginFeatures.java index 4aff97f413..99c9b84d76 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/RunPluginFeatures.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/RunPluginFeatures.java @@ -48,7 +48,7 @@ public class RunPluginFeatures implements PluginFeatures { project.getTasks().all(new Action() { @Override public void execute(Task task) { - if(task instanceof JavaExec || task instanceof CreateStartScripts) { + if (task instanceof JavaExec || task instanceof CreateStartScripts) { task.dependsOn(FIND_MAIN_CLASS_TASK_NAME); } } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/SourceSets.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/SourceSets.java index b648a728bb..c96d09b599 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/SourceSets.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/SourceSets.java @@ -42,7 +42,7 @@ class SourceSets { private static Iterable getJavaSourceSets(Project project) { JavaPluginConvention plugin = project.getConvention().getPlugin( JavaPluginConvention.class); - if(plugin == null) { + if (plugin == null) { return Collections.emptyList(); } return plugin.getSourceSets(); diff --git a/spring-boot/src/main/java/org/springframework/boot/yaml/YamlProcessor.java b/spring-boot/src/main/java/org/springframework/boot/yaml/YamlProcessor.java index 29b54aa44f..818401ba26 100644 --- a/spring-boot/src/main/java/org/springframework/boot/yaml/YamlProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/yaml/YamlProcessor.java @@ -53,8 +53,8 @@ public abstract class YamlProcessor { /** * A map of document matchers allowing callers to selectively use only some of the - * documents in a YAML resource. In YAML documents are separated by - * --- lines, and each document is converted to properties before the match is made. E.g. + * documents in a YAML resource. In YAML documents are separated by --- + * lines, and each document is converted to properties before the match is made. E.g. * *
 	 * environment: dev
@@ -66,7 +66,8 @@ public abstract class YamlProcessor {
 	 * name: My Cool App
 	 * 
* - * when mapped with documentMatchers = YamlProcessor.mapMatcher({"environment": "prod"}) + * when mapped with + * documentMatchers = YamlProcessor.mapMatcher({"environment": "prod"}) * would end up as * *