Skip to content

Commit f39b044

Browse files
author
Dave Syer
committed
Fix packaging for Layout.NONE
Fixes spring-projectsgh-139
1 parent 40bfd29 commit f39b044

File tree

2 files changed

+5
-1
lines changed
  • spring-boot-tools/spring-boot-loader-tools/src

2 files changed

+5
-1
lines changed

spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ public void library(File file, LibraryScope scope) throws IOException {
145145
}
146146
}
147147
});
148-
writer.writeLoaderClasses();
148+
if (!(this.layout instanceof Layouts.None)) {
149+
writer.writeLoaderClasses();
150+
}
149151
}
150152
finally {
151153
try {

spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/RepackagerTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public void noMainClassAndLayoutIsNone() throws Exception {
148148
Manifest actualManifest = getManifest(file);
149149
assertThat(actualManifest.getMainAttributes().getValue("Main-Class"),
150150
equalTo("a.b.C"));
151+
assertThat(hasLauncherClasses(file), equalTo(false));
151152
}
152153

153154
@Test
@@ -160,6 +161,7 @@ public void noMainClassAndLayoutIsNoneWithNoMain() throws Exception {
160161
Manifest actualManifest = getManifest(file);
161162
assertThat(actualManifest.getMainAttributes().getValue("Main-Class"),
162163
equalTo(null));
164+
assertThat(hasLauncherClasses(file), equalTo(false));
163165
}
164166

165167
@Test

0 commit comments

Comments
 (0)