Spring Boot multi module project with Gradle doesn't build

前端 未结 4 957
有刺的猬
有刺的猬 2021-01-31 03:29

I\'m working on a Spring Boot app with multiple modules and we\'re using Gradle to build it. Unfortunately I can\'t get the Gradle configuration right.

The project stru

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-31 04:17

    You should exclude org.springframework.boot from all submodules (root build.gradle file, allProjects block), that are stands as dependencies for your core module, which will be build to fat-jar.

    Include dependencyManagement configuration into all of your spring-boot managed submodules:

    dependencyManagement {
        imports {
            mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}"
        }
    }
    

    The reason of your problem is the absence of submodules compiled jar files inside your core module fat-jar.

提交回复
热议问题