SpringBoot 2.0.0.BUILD-SNAPSHOT gradle plugin is breaking multi-project dependencies
See original GitHub issueWe encountered an issue about two weeks ago while using SpringBoot 2.0.0 Snapshot.
Seems recent changes break multi project dependencies.
The line
compile project(':somemodule') seems to be validated for project existence but not for setting the classpath. Meaning, if I change somemodule to any text that does not relate to a mobule in my multi module project, it will complain. But nevertheless it does not find the classes that were successfully compiled on the exiting related module.
To make sure it is not related to our specific build I have taken https://github.com/spring-guides/gs-multi-module And converted it to use 2.0.0.BUILD-SNAPSHOT
I am getting the same errors:
:library:compileJava UP-TO-DATE
:library:processResources NO-SOURCE
:library:classes UP-TO-DATE
:library:jar SKIPPED
/Users/yuval/dev/gs-multi-module/complete/application/src/main/java/hello/app/DemoApplication.java:10: error: package hello.service does not exist
import hello.service.Service;
^
/Users/yuval/dev/gs-multi-module/complete/application/src/main/java/hello/app/DemoApplication.java:11: error: package hello.service does not exist
import hello.service.ServiceConfiguration;
^
/Users/yuval/dev/gs-multi-module/complete/application/src/main/java/hello/app/DemoApplication.java:18: error: cannot find symbol
private final Service service;
^
symbol: class Service
location: class DemoApplication
/Users/yuval/dev/gs-multi-module/complete/application/src/main/java/hello/app/DemoApplication.java:21: error: cannot find symbol
public DemoApplication(Service service) {
^
symbol: class Service
location: class DemoApplication
/Users/yuval/dev/gs-multi-module/complete/application/src/main/java/hello/app/DemoApplication.java:14: error: cannot find symbol
@Import(ServiceConfiguration.class)
^
symbol: class ServiceConfiguration
5 errors
:application:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':application:compileJava'.
> Compilation failed; see the compiler error output for details.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Gradle Could not resolve org.springframework.boot:spring ...
Your build file does not have the spring boot plugin. apply plugin: 'org.springframework.boot'. Without this the dependency management system is broken for ...
Read more >Overriding Dependency Versions with Spring Boot
This article explains some of the dependency management tricks that can be used to create libraries and apps that depend on newer versions...
Read more >Upgrading your build from Gradle 6.x to the latest
Some plugins will break with this new version of Gradle, for example because they use ... Many Gradle builds rely on JCenter for...
Read more >3 Upgrading from the previous versions 5.2.5
If you have grails plugins as part of multi-project builds you should also replace ... This is described in the Spring Boot Gradle...
Read more >Log4j – Maven, Ivy, Gradle, and SBT Artifacts
To build with Gradle, add the dependencies listed below to your ... plugins { id 'io.spring.dependency-management' version '1.0.1.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@mrmeisen in your lib project’s build.gradle disable bootJar and re-enable the jar tasks via
It looks like you introduced a bug during the conversion. The library project appears to have the Spring Boot plugin applied to it. By default that disables the
jartask in favour of thebootJartask. I would recommend that you only apply the Spring Boot plugin to the project that contains your application. As shown in the guide to which you have linked, other modules should just be configured with dependency management.In the future, please raise this sort of question on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.