Merge branch '1.3.x'

This commit is contained in:
Andy Wilkinson
2016-06-15 20:22:56 +01:00
3 changed files with 30 additions and 4 deletions

View File

@@ -163,6 +163,17 @@ public class RepackagingTests {
assertThat(isDevToolsJarIncluded(repackageFile)).isFalse();
}
@Test
public void customRepackagingTaskWithOwnMainClassNameAnNoGlobalMainClassName() {
project.newBuild().forTasks("clean", "customRepackagedJarWithOwnMainClass")
.withArguments("-PbootVersion=" + BOOT_VERSION, "-Prepackage=true",
"-PexcludeDevtools=false", "-PnoMainClass=true")
.run();
File buildLibs = new File("target/repackage/build/libs");
assertThat(new File(buildLibs, "custom.jar").exists()).isTrue();
assertThat(new File(buildLibs, "custom.jar.original").exists()).isTrue();
}
private boolean isDevToolsJarIncluded(File repackageFile) throws IOException {
JarFile jarFile = new JarFile(repackageFile);
try {

View File

@@ -23,7 +23,9 @@ dependencies {
}
springBoot {
mainClass = 'foo.bar.Baz'
if (!project.hasProperty("noMainClass")) {
mainClass = 'foo.bar.Baz'
}
excludeDevtools = Boolean.valueOf(project.excludeDevtools)
}
@@ -50,3 +52,8 @@ task customRepackagedJar(type: BootRepackage, dependsOn: customJar) {
task customRepackagedJarWithStringReference(type: BootRepackage, dependsOn: customJar) {
withJarTask = 'customJar'
}
task customRepackagedJarWithOwnMainClass(type: BootRepackage, dependsOn: customJar) {
withJarTask = customJar
mainClass = 'foo.bar.Baz'
}