maven junit.framework不存在问题解决
来源:互联网 发布:矩阵a与b相似,则a与b 编辑:程序博客网 时间:2024/05/24 05:01
问题
在使用maven进行一个工程的编译,已加入junit包的依赖,编译的时候却总是报“junit.framework不存在”错误。
pom.xml中junit包加入如下:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency>
解决
试了N多方法,包括加入junit-dep包,依然解决不了问题,后来在加junit-dep包的时候发现,原来多了一个scope属性,将scope属性去掉后恢复正常。
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency>
原来依赖加入scope属性后,就会被约束在该生命周期内,在compile阶段不引入test阶段的依赖,也就是说编译阶段该依赖无效。
如果修改scope属性,则也可以正常运行:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>compile</scope> </dependency>
0 0
- maven junit.framework不存在问题解决
- maven打包时 junit.framework不存在
- maven 程序包org.junit不存在
- maven 程序包org.junit不存在
- maven 程序包org.junit不存在
- 软件包 junit.framework 不存在的解决方法
- maven spring 软件包org.junit不存在
- maven deploy 程序包org.junit不存在
- Maven打包 错误: 程序包org.junit不存在
- ant编译时报错:程序包junit.framework不存在
- Maven编译报:编码GBK的不可映射字符与程序包org.junit.runner不存在
- Intellij IDEA配置maven项目中出现的“程序包org.junit不存在”错误
- maven JUnit
- 一点一点学maven(11)——Eclipse开发Maven项目提示:程序包org.junit不存在解决方案
- JUnit 介绍--- junit.framework.TestCase
- mswinsck.ocx不存在问题解决
- 用Junit Framework編寫單元測試
- [Junit]What's framework
- uva11520填字母
- OpenGL入门学习
- BGRABitmap图像操作1:最简单的例子,在窗体上画一个长方体
- RecyclerView侧滑菜单,RecyclerView滑动删除,RecyclerView长按拖拽
- leetcode:数学:Water and Jug Problem(365)
- maven junit.framework不存在问题解决
- 为CentOS系统设置固定IP
- fastdfs和其他文件系统区别
- linux中的umask
- 使用消息队列的10个理由
- 909422229__Android UI基础之一【本人总结,适用于新手】
- iOS编译报错之directory not found for option XXX
- leetcode:数学:Largest Divisible Subset(368)
- Parajumpers Dames expected wrong words