简体   繁体   English

Gradle 测试对主要源集的依赖

[英]Gradle test dependency on main sourceset

I'm using gradle to build my spring-boot project with the java plugin and I need to explicitly describe that the Test Source Sets depends on the Main source set in order for Intellij to see the main classes.我正在使用 gradle 用java插件构建我的 spring-boot 项目,我需要明确描述测试源集依赖于主源集,以便 Intellij 看到主类。 Shouldn't this be implied?这不应该是暗示吗?

dependencies {
    testCompile sourceSets.main.output
}

Having the same issue with spring boot 2.4. Spring Boot 2.4 也有同样的问题。

The dependencies could be removed, after upgrading to spring boot 2.5.升级到 spring boot 2.5 后,可以删除依赖项。

Tested with spring boot sample project: https://spring.io/guides/gs/spring-boot/用spring boot示例项目测试: https : //spring.io/guides/gs/spring-boot/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM