我希望从测试中排除两个jars,并且只在应用程序实际运行时使用它们。
dependencies {
runtimeOnly('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client')
runtimeOnly('org.springframework.cloud:spring-cloud-starter-config')
}在运行测试期间,我如何明确地告诉Gradle 5不要加载这些jars?我已经禁用了他们的使用,但他们还是继续上膛。我本来希望能得到像下面这样简单的东西,但我一直找不到确切的答案。
test.exclude {
group 'org.springframework.cloud'
}编辑
复制糊溶液
configurations.testCompile.exclude(group: 'org.springframework.cloud', module: 'spring-cloud-starter-netflix-eureka-client')
configurations.testCompile.exclude(group: 'org.springframework.cloud', module: 'spring-cloud-starter-config')发布于 2020-06-17 12:18:58
在依赖项块中,可以执行以下操作:
configurations.testCompile.exclude(group: 'the-group', module: 'the-module')希望这能有所帮助!
https://stackoverflow.com/questions/62426519
复制相似问题