1. ProjectA build.gradle

task testsJar(type: Jar, dependsOn: testClasses) {
    classifier = 'tests'
    from sourceSets.test.output
}

configurations {
    tests
}

artifacts {
    tests testsJar
    archives testsJar
}

jar.finalizedBy(testsJar)

2. ProjectB build.gradle

dependencies {

  compile project(':projecta')

  testCompile project(path: ':projecta', configuration: 'tests')

}

 

相关文章:

  • 2022-12-23
  • 2021-05-29
  • 2021-06-27
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2021-09-09
  • 2022-12-23
  • 2022-01-20
  • 2022-02-17
  • 2021-09-06
相关资源
相似解决方案