Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass Debug Flag to Spring Boot via Gradle bootRun to view AutoConfigure information

So i'm working on the Consuming Rest Services with Spring Boot Tutorial and trying to figure out how it's wiring the AutoConfigure with Jackson and RestTemplate.

I have been told I can pass the --debug flag to Spring Boot. This would make Spring Boot emit it's Auto Configuration information.

Currently I'm running this via the gradle bootRun task that comes with the Spring Boot gradle plugin. This is being run via an IntelliJ Run Configuration in this image.

IntelliJ Run Configuration

How do I pass a --debug flag so that Spring Boot picks it up. If I put this in the VM Options, gradle picks it up and starts emitting all of it's information (which I don't want).

like image 750
Shaun Avatar asked Dec 04 '15 03:12

Shaun


1 Answers

I suppose, to do that, you have to configure your bootRun task, something like:

bootRun {
  if ( project.hasProperty('springDebug') ) {
      args '--debug'
  }
}

Then you can provide a springDebug flag for your build to run the application in debug mode and not affecting the gradle debug.

like image 114
Stanislav Avatar answered Oct 12 '22 12:10

Stanislav