Philip Tenn
Philip Tenn

Reputation: 6083

Gradle Spring Boot Dependency: Include for bootRun / Exclude for bootJar

I have a JavaAgent JAR that needs to be:

What I've tried thus far:

compileOnly "com.quartzdesk:quartzdesk-agent:3.6.0"

This is not including the JAR in either bootRun or bootJar

runtime "com.quartzdesk:quartzdesk-agent:3.6.0"

This is including the JAR in both bootRun AND bootJar (surprised it is included in bootJar).

Any suggestions would be greatly appreciated. Thank you!

Upvotes: 3

Views: 1030

Answers (1)

Vladimir Shefer
Vladimir Shefer

Reputation: 739

surprised it is included in bootJar

runtime dependency means that it is not included in classpath in compile time, but it is still packaged in final jar into libs and loaded in classpath on application startup.

This is much useful for dependencies, which are not used in your application source codes like JDBC-drivers or Liquibase.

Upvotes: 1

Related Questions