任庆博

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

关于Spring框架,@Runwith报红问题

父项目中有

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
子项目中有
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.3.13</version>
</dependency>

而使用注解@RunWith和@Test报红
我的理解是没有引入到父项目的依赖,所以我的解决办法是加<parent></parent>
<parent>
<groupId>Com.Ren</groupId>
<artifactId>SpringExercise02</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

当然也可以在子项目中重新添加依赖

posted on   不捡自然无  阅读(1003)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
点击右上角即可分享
微信分享提示