spring boot - Gradle multi project doesnt implement projects - Stack Overflow

i have this spring boot project structure:root--ui--tracksettings.gradlebuild.gradlein rootsetti

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 badge
Add a comment  | 

1 Answer 1

Reset to default 1

There 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744846587a4596874.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信