i have this spring boot project structure:
root --ui --track settings.gradle build.gradle
in root/settings.gradle:
rootProject.name = 'root'
include 'track', 'ui'
I want to use ui in track:
root/track/build.gradle:
dependencies {
//other
implementation project(':ui')
}
root/track/settings.gradle:
rootProject.name = 'track'
include 'ui'
root/ui/settings.gradle:
rootProject.name = 'ui'
when i tray to build track i get this error:
Could not determine the dependencies of task ':compileJava'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not resolve project :ui.
Required by:
root project :
> No matching variant of project :ui was found. The consumer was configured to find a library for use during compile-time, compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
- No variants exist.
ui is basically just a spring boot project which hols the templates for some layout html etc that other modules should use. The way i tried it is what chatGpt suggests.
i have this spring boot project structure:
root --ui --track settings.gradle build.gradle
in root/settings.gradle:
rootProject.name = 'root'
include 'track', 'ui'
I want to use ui in track:
root/track/build.gradle:
dependencies {
//other
implementation project(':ui')
}
root/track/settings.gradle:
rootProject.name = 'track'
include 'ui'
root/ui/settings.gradle:
rootProject.name = 'ui'
when i tray to build track i get this error:
Could not determine the dependencies of task ':compileJava'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not resolve project :ui.
Required by:
root project :
> No matching variant of project :ui was found. The consumer was configured to find a library for use during compile-time, compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
- No variants exist.
ui is basically just a spring boot project which hols the templates for some layout html etc that other modules should use. The way i tried it is what chatGpt suggests.
Share Improve this question asked Mar 10 at 12:34 Timo NeskeTimo Neske 71 bronze badge1 Answer
Reset to default 1There is one one settings.gradle
file per multi-module project which sits in the root folder and specifies the subprojects to include. The other settings.gradle
files should be removed.
Then the track
module should be able to find the ui
module to add as a dependency.