报错ooc/maven01/model/HelloWorldTest.java:[9,57] 找不到符号
package com.imooc.maven01.model;
import org.junit.*;
import org.junit.Assert.*;
public class HelloWorldTest{
@Test
public void testHello(){
Assert.assertEquals("Hello World!", new HelloWorld().sayHello());
}
}
------
package com.imooc.maven01.mode1;
public class HelloWorld{
public String sayHello(){
return "Hello World";
}
}
package com.imooc.maven01.mode1;
public class HelloWorld{
public String sayHello(){
return "Hello World";
}
}
------
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.imooc.maven01</groupId>
<artifactId>maven01-model</artifactId>
<version>0.0.1SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
</dependencies>
</project>
在 mvn compile 操作 success
在 mvn test 操作 报找不到符号