关于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>

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM