Gradle: common resource dependency for multiple java projects

后端 未结 6 529
鱼传尺愫
鱼传尺愫 2020-12-28 17:47

I\'m developing a multi-module project with gradle/intellij-idea, and here is the structure of my project home:

project/
  sub-project-1
    /main/resources
         


        
6条回答
  •  不思量自难忘°
    2020-12-28 18:31

    Ok, I figured it out. It's actually pretty simple. Just treat the "data" folder as another project and add dependency declarations to sub projects will do the trick. For example:

    dependencies {
        compile project (':data')
        testCompile project (':data')
    }
    

提交回复
热议问题