Skip to content

Commit d588bf7

Browse files
committed
Fix odd Java parsing issues
Update `LoggingMainClassTimeWarningListener` to import individual `Layout` inner classes. This fixes an odd javac parse issue that otherwise occurs. See gh-9316
1 parent c6f930b commit d588bf7

File tree

1 file changed

+22
-19
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven

1 file changed

+22
-19
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
import org.springframework.boot.loader.tools.LaunchScript;
4242
import org.springframework.boot.loader.tools.Layout;
4343
import org.springframework.boot.loader.tools.LayoutFactory;
44-
import org.springframework.boot.loader.tools.Layouts;
44+
import org.springframework.boot.loader.tools.Layouts.Expanded;
45+
import org.springframework.boot.loader.tools.Layouts.Jar;
46+
import org.springframework.boot.loader.tools.Layouts.None;
47+
import org.springframework.boot.loader.tools.Layouts.War;
4548
import org.springframework.boot.loader.tools.Libraries;
4649
import org.springframework.boot.loader.tools.Repackager;
4750
import org.springframework.boot.loader.tools.Repackager.MainClassTimeoutWarningListener;
@@ -323,6 +326,17 @@ else if (!source.equals(repackaged)) {
323326
}
324327
}
325328

329+
private class LoggingMainClassTimeoutWarningListener
330+
implements MainClassTimeoutWarningListener {
331+
332+
@Override
333+
public void handleTimeoutWarning(long duration, String mainMethod) {
334+
getLog().warn("Searching for the main-class is taking some time, "
335+
+ "consider using the mainClass configuration " + "parameter");
336+
}
337+
338+
}
339+
326340
/**
327341
* Archive layout types.
328342
*/
@@ -331,47 +345,36 @@ public enum LayoutType {
331345
/**
332346
* Jar Layout.
333347
*/
334-
JAR(new Layouts.Jar()),
348+
JAR(new Jar()),
335349

336350
/**
337351
* War Layout.
338352
*/
339-
WAR(new Layouts.War()),
353+
WAR(new War()),
340354

341355
/**
342356
* Zip Layout.
343357
*/
344-
ZIP(new Layouts.Expanded()),
358+
ZIP(new Expanded()),
345359

346360
/**
347361
* Dir Layout.
348362
*/
349-
DIR(new Layouts.Expanded()),
363+
DIR(new Expanded()),
350364

351365
/**
352366
* No Layout.
353367
*/
354-
NONE(new Layouts.None());
368+
NONE(new None());
355369

356370
private final Layout layout;
357371

358-
public Layout layout() {
359-
return this.layout;
360-
}
361-
362372
LayoutType(Layout layout) {
363373
this.layout = layout;
364374
}
365375

366-
}
367-
368-
private class LoggingMainClassTimeoutWarningListener
369-
implements MainClassTimeoutWarningListener {
370-
371-
@Override
372-
public void handleTimeoutWarning(long duration, String mainMethod) {
373-
getLog().warn("Searching for the main-class is taking some time, "
374-
+ "consider using the mainClass configuration " + "parameter");
376+
public Layout layout() {
377+
return this.layout;
375378
}
376379

377380
}

0 commit comments

Comments
 (0)