2 neqrhk NeQrhk 于 2016.04.17 22:00 提问

maven问题,编译错误,谁帮忙看下谢了

D:\code\maven01\src\main\java\com\imooc\maven01\model
里面有java文件如下
package com.imooc.maven01.model;
public class HelloWorld{
public String sayHello(){
return "Hello World";
}
}
D:\code\maven01\src\test\java\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());
}
}
有导入junit包了

D:\code\maven01>mvn compile
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM D:\code\maven01\pom.xml: expected = after attribute na
me (position: START_DOCUMENT seen ....0.0" xmlns:xsi="http://www.w3.org/2001/XML
Schema-instance" xsi:\ns... @4:2) @ line 4, column 2
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (D:\code\maven01\pom.xml) has 1 error
[ERROR] Non-parseable POM D:\code\maven01\pom.xml: expected = after attribut
e name (position: START_DOCUMENT seen ....0.0" xmlns:xsi="http://www.w3.org/2001
/XMLSchema-instance" xsi:\ns... @4:2) @ line 4, column 2 -> [Help 2]
[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/ProjectBuildin
gException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseExce
ption

编译错误

2个回答

devmiao
devmiao   Ds   Rxr 2016.04.18 05:11
baidu_21764787
baidu_21764787   2016.06.23 23:41

pom.xml中有错误,修改后重新试试

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!