Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot Gradle bootRun task default classpath and current working directory

I am going to test external config for application. What is default classpath and default working directory for Spring Boot Gradle bootRun task?

I didn't get in from:

  • http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-running-your-application.html
  • https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-gradle-plugin.html

UPDATE test with System.getProperty("user.dir") show that current directory is where Gradle is started.

like image 443
gavenkoa Avatar asked Dec 16 '25 13:12

gavenkoa


1 Answers

Working directory is actually the module with Spring Boot project, which does not necessarily have to be the rootProject.

Classpath for bootRun is:

  • working directory (or Gradle project directory with Spring Boot)
  • main classes
  • runtime classpath

At least this is what seems to be the default when I debug the build (now easily possible with IntelliJ IDEA 2018.2).

like image 163
virgo47 Avatar answered Dec 19 '25 06:12

virgo47



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!