Apply latest eclipse cleanup rules
This commit is contained in:
@@ -28,7 +28,7 @@ import org.springframework.boot.loader.tools.LibraryScope;
|
||||
|
||||
/**
|
||||
* Expose Gradle {@link Configuration}s as {@link Libraries}.
|
||||
*
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
class ProjectLibraries implements Libraries {
|
||||
@@ -41,6 +41,7 @@ class ProjectLibraries implements Libraries {
|
||||
|
||||
/**
|
||||
* Create a new {@link ProjectLibraries} instance of the specified {@link Project}.
|
||||
*
|
||||
* @param project the gradle project
|
||||
*/
|
||||
public ProjectLibraries(Project project) {
|
||||
@@ -49,6 +50,7 @@ class ProjectLibraries implements Libraries {
|
||||
|
||||
/**
|
||||
* Set the name of the provided configuration. Defaults to 'providedRuntime'.
|
||||
*
|
||||
* @param providedConfigurationName the providedConfigurationName to set
|
||||
*/
|
||||
public void setProvidedConfigurationName(String providedConfigurationName) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.boot.loader.tools.Repackager;
|
||||
|
||||
/**
|
||||
* Repackage task.
|
||||
*
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public class Repackage extends DefaultTask {
|
||||
@@ -78,13 +78,16 @@ public class Repackage extends DefaultTask {
|
||||
File file = archive.getArchivePath();
|
||||
if (file.exists()) {
|
||||
Repackager repackager = new Repackager(file) {
|
||||
protected String findMainMethod(java.util.jar.JarFile source) throws IOException {
|
||||
|
||||
@Override
|
||||
protected String findMainMethod(java.util.jar.JarFile source)
|
||||
throws IOException {
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
return super.findMainMethod(source);
|
||||
}
|
||||
finally {
|
||||
long duration = System.currentTimeMillis() - startTime;
|
||||
} finally {
|
||||
long duration = System.currentTimeMillis()
|
||||
- startTime;
|
||||
if (duration > FIND_WARNING_TIMEOUT) {
|
||||
getLogger().warn(
|
||||
"Searching for the main-class is taking some time, "
|
||||
|
||||
@@ -50,6 +50,8 @@ public class RunApp extends DefaultTask {
|
||||
JavaPluginConvention javaConvention = project.getConvention().getPlugin(
|
||||
JavaPluginConvention.class);
|
||||
javaConvention.getSourceSets().all(new Action<SourceSet>() {
|
||||
|
||||
@Override
|
||||
public void execute(SourceSet set) {
|
||||
if (SourceSet.MAIN_SOURCE_SET_NAME.equals(set.getName())) {
|
||||
main = set;
|
||||
@@ -64,10 +66,11 @@ public class RunApp extends DefaultTask {
|
||||
}
|
||||
|
||||
project.getTasks().withType(JavaExec.class, new Action<JavaExec>() {
|
||||
|
||||
@Override
|
||||
public void execute(JavaExec exec) {
|
||||
ArrayList<File> files = new ArrayList<File>(exec.getClasspath()
|
||||
.getFiles());
|
||||
ArrayList<File> files = new ArrayList<File>(
|
||||
exec.getClasspath().getFiles());
|
||||
files.addAll(0, allResources);
|
||||
getLogger().info("Adding classpath: " + allResources);
|
||||
exec.setClasspath(new SimpleFileCollection(files));
|
||||
@@ -75,6 +78,7 @@ public class RunApp extends DefaultTask {
|
||||
final String mainClass = findMainClass(main);
|
||||
exec.setMain(mainClass);
|
||||
exec.getConventionMapping().map("main", new Callable<String>() {
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return mainClass;
|
||||
|
||||
Reference in New Issue
Block a user