为了账号安全,请及时绑定邮箱和手机立即绑定

第三课时,完全按照视频步骤做,会报错,还没找到解决方法。错误代码如下

<?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.1-SHAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>juntil</groupId>
            <artifactId>juntil</artifactId>    
            <version>4.10</version>
        </dependency>
    </dependencies>     
</project>

pom.xml如上所示

在命令行中找到项目所在位置 运行mvn compile后出现以下错误

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM E:\code\maven01\pom.xml: only whitespace content allowed before start tag and not / (position: START_DOCUMENT seen <?xml version="1.0" encoding="UTF-8"?>\n/... @2:2)  @ line 2, column 2
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project  (E:\code\maven01\pom.xml) has 1 error
[ERROR]     Non-parseable POM E:\code\maven01\pom.xml: only whitespace content allowed before start tag and not / (position: START_DOCUMENT seen <?xml version="1.0" encoding="UTF-8"?>\n/... @2:2)  @ line 2, column 2 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException

正在回答

4 回答

是“junit”而不是“juntil”

0 回复 有任何疑惑可以回复我~

pom.cml如下所示

<?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.1-SHAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>juntil</groupId>
            <artifactId>juntil</artifactId>    
            <version>4.10</version>
        </dependency>
    </dependencies>     
</project>



0 回复 有任何疑惑可以回复我~

楼上说的对,是pom.xml问题

0 回复 有任何疑惑可以回复我~
#1

qq_马奔腾 提问者

您好,代码已贴,您能帮我看一下么
2017-11-16 回复 有任何疑惑可以回复我~

pom.xml有问题,代码贴一下吧?

0 回复 有任何疑惑可以回复我~
#1

qq_马奔腾 提问者

不好意思,之前忘了贴代码,现在贴上了,您能帮我看一下哪里有错么?
2017-11-16 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
项目管理利器——maven
  • 参与学习       173090    人
  • 解答问题       742    个

使用maven来构建和管理Java项目,从环境配置,到maven核心知识

进入课程

第三课时,完全按照视频步骤做,会报错,还没找到解决方法。错误代码如下

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信