我正在为我的 Maven 项目创建测试类,但是 Maven 无法导入 JUnit,有什么想法吗?
类Recipebook/src/test/java/RecipebookTest.java:
import org.junit.Test;
import org.junit.Before;
/**
*
* @author Mimo
*/
public class RecipebookTest {
@Before
protected void setUp() throws Exception {
}
}
我的 pom.xml 文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org /2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fi.muni</groupId>
<artifactId>Recipebook</artifactId>
<version>2.1.0</version>
<packaging>jar</packaging>
<name>Recipebook</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</project>
谢谢