1

We have been using gradle spring boot plugin version 1.5.14 and gradle 4.10.3 for our builds. After an upgrade of gradle to 6.2.2, we've also changed dependency-definition from compile group to implementation group i.e.:

compile group: 'org.springframework.boot', name: 'spring-boot-starter-integration'

to

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-integration'.

The fat jar created via gradle assemble does to my surprise not contain the required libs under BOOT-INF/lib anymore? If I replace "implementation" with "compile" it works again as expected.

Is there something which needs to be configured so that spring-boot-plugin adds them? Or do I need to upgrade the project to spring boot 2 beforehand?

Younes El Ouarti
  • 2,200
  • 2
  • 20
  • 31

1 Answers1

1

Implementation will bring in the dependency only for that module it is declared in.

Compile will allow a module that depends on the module to use the dependency as well.

Say you have Module A depending on Module B. Module A and B both need the dependency:

com.font:font1:1.1.1

If B uses:

implementation 'com.font:font1:1.1.1'

A will not see font1, and will need to bring it into its own build.gradle file as well.

compile 'com.font:font1:1.1.1' 

will make it available to the entire classpath (which should be avoided anyway, and the new equivalent is for libraries which uses 'api' instead of 'compile').

Without seeing your project directory, I'm assuming that some dependency is not being pulled into a place where it used to be grabbed from a lower dependency in the hierarchy. You should be able to find the missing dependencies easily by changing compile to implementation one at a time, unless you have a huge multi-module project.

Lukos
  • 712
  • 4
  • 5