Make test work on command line properly

Surefire wraps everything in a .jar to run the tests, and the
manifest has a main class, so that fools the main class
detection.
This commit is contained in:
Dave Syer
2018-11-17 15:27:11 +00:00
parent 80c65e2786
commit c285a0f082

View File

@@ -220,7 +220,9 @@ class FunctionCreatorConfiguration {
if (mainClass == null) {
mainClass = manifest.getMainAttributes().getValue("Start-Class");
}
if (mainClass == null) {
if (mainClass == null
// Not surefire or IntelliJ
&& !getArchive().getUrl().toString().endsWith(".jar!/")) {
// Not a Spring Boot jar but it might have a "main" class
mainClass = manifest.getMainAttributes().getValue("Main-Class");
}