spring-attic / spring-ide

Spring Development Environment for Eclipse
299 stars 125 forks source link

Boot Dashboard + Gradle + Spring Actuator "/info" #298

Open ericis opened 6 years ago

ericis commented 6 years ago

The ./info endpoint is empty when the application is run from Boot Dashboard. However, it is correctly populated when running the bootRun gradle task inside IDE's Gradle Tasks window or via command-line (./gradlew bootRun). The file is properly generated at ./build/resources/main/META-INF/build-info.properties.

I have a feeling this is due to some output directory nonsense that I feel should "just work", but probably have to modify something to get it to work... 👎

Generating build info in ./build.gradle:

springBoot {
    // This statement tells the Gradle Spring Boot plugin to generate a file
    // build/resources/main/META-INF/build-info.properties that is picked up 
    // by Spring Boot to display via /info endpoint.
    // https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/#integrating-with-actuator-build-info
    buildInfo()
}

Related issue: #59

kdvolder commented 6 years ago

The problem is likely that gradle + eclipse + buildship doesn't do these extra build steps implied by the code snippet. STS doesn't really control this, it is ultimately BuildShip's responsibility to integrate gradle with Eclipse and configure projects so that Eclipse workspace builds behave (as much as possible) the same as if you would build a project on the commandline.

I agree though this discrepancy is undesirable.

Also its worth for us to trouble-shoot this a bit to understand / confirm what is really going on. Maybe there is something we can do in STS, or otherwise we can decide if it should be filed as bug against someone else (e.g. BuildShip).

A sample project to reproduce the issue would be helpful if you can attach one.