|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2016 the original author or authors.
|
|
|
|
|
* Copyright 2012-2017 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.
|
|
|
|
@ -33,6 +33,8 @@ import org.gradle.api.tasks.bundling.Jar;
|
|
|
|
|
import org.springframework.boot.gradle.SpringBootPluginExtension;
|
|
|
|
|
import org.springframework.boot.loader.tools.DefaultLaunchScript;
|
|
|
|
|
import org.springframework.boot.loader.tools.LaunchScript;
|
|
|
|
|
import org.springframework.boot.loader.tools.Layout;
|
|
|
|
|
import org.springframework.boot.loader.tools.Layouts;
|
|
|
|
|
import org.springframework.boot.loader.tools.Repackager;
|
|
|
|
|
import org.springframework.boot.loader.tools.Repackager.MainClassTimeoutWarningListener;
|
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
|
@ -207,6 +209,7 @@ public class RepackageTask extends DefaultTask {
|
|
|
|
|
return task.equals(withJarTask) || task.getName().equals(withJarTask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
|
private void repackage(File file) {
|
|
|
|
|
File outputFile = RepackageTask.this.outputFile;
|
|
|
|
|
if (outputFile != null && !file.equals(outputFile)) {
|
|
|
|
@ -218,8 +221,13 @@ public class RepackageTask extends DefaultTask {
|
|
|
|
|
repackager.addMainClassTimeoutWarningListener(
|
|
|
|
|
new LoggingMainClassTimeoutWarningListener());
|
|
|
|
|
setMainClass(repackager);
|
|
|
|
|
if (this.extension.convertLayout() != null) {
|
|
|
|
|
repackager.setLayout(this.extension.convertLayout());
|
|
|
|
|
Layout layout = this.extension.convertLayout();
|
|
|
|
|
if (layout != null) {
|
|
|
|
|
if (layout instanceof Layouts.Module) {
|
|
|
|
|
getLogger().warn("Module layout is deprecated. Please use a custom"
|
|
|
|
|
+ " LayoutFactory instead.");
|
|
|
|
|
}
|
|
|
|
|
repackager.setLayout(layout);
|
|
|
|
|
}
|
|
|
|
|
repackager.setBackupSource(this.extension.isBackupSource());
|
|
|
|
|
try {
|
|
|
|
|