需要class, interface或enum[ERROR] ?
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.347 s
[INFO] Finished at: 2016-12-05T19:14:22+08:00
[INFO] Final Memory: 9M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project maven01-model: Compilation failure
[ERROR] /E:/apache-maven-3.3.9-bin/code/maven01/src/main/java/com/imooc/maven01/
model/HelloWorld.java:[1,1] 需要class, interface或enum
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
-----------
以上是报错,下面是代码
---------
paceage com.imooc.maven01.model;
public class HelloWorld {
public String sayHello() {
return "HelloWorld!";
}
}
public class HelloWorldTest{
@Test
public String TestHello(){
Assert.assertEquals("HelloWorld!",new HelloWorlde().sayHello());
}
}
<?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>