Components
- Spring Download 1.4.3 (and also tried with Spring Boot 1.5 RC1)
- Java 1.8.0_112 on Mac OS Sierra
- Gradle 3.3 / Maven 3.3.9
- A simple Java web application configured with the Spring Boot Gradle plugin (the same problem seems to apply to the Spring Boot Maven boot plugin)
Problem
Attempting to run the application using gradlew clean build bootRun or just gradlew bootRun shows that the gradle / java process crashes without errors. No more errors or logs are displayed except:
"/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java completed with non-zero output value 1".
Running gradlew bootRun --debug however shows that the BootRun task (an extension of the JavaExec Gradle task) seems to want to generate a VERY VERY long Classpath entry that ultimately bombes the Java process.
Spring boot documentation indicates:
To execute a project on site without creating a jar, you can use the "bootRun" task
http://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-gradle-plugin.html#build-tool-plugins-gradle-running-applications
But it doesn't seem like this method can work if the plugin needs to generate such long paths.
Play
This project may show the problem:
https://github.com/apereo/cas-gradle-overlay-template
In the cas/build.gradle you can add a dependency to monitor the behavior:
compile "org.apereo.cas:cas-server-support-json-service-registry:${project.'cas.version'}"
Diagnostics
The project contains the following dependency:
dependencies { compile "somewhere:something: somehow@war " }
This does not present any problems for bootRun ; however, when any other compilation / runtime dependency is added to the project, all dependent transitive or other values ββare added to the class path for bootRun to execute.
I also tried to create a "pathing" JAR with the hope that the / Java plugin could just use the Class-Path entry in this JAR manifest to launch the web application, and the classpath element passed to the java command would be shortened like for example. However, it made no difference, and Java just crashed again.
Note that running a web application as an executable flag using java -jar app.war works fine with all dependencies, etc.
Do others have problems with similar problems?