按照视频的操作,连文件名都一样,mvn编译出错
出错
E:\hellomaven>mvn compile [INFO] Scanning for projects... [INFO] [INFO] ----------------------< com.imooc.app:hellomaven >---------------------- [INFO] Building hellomaven 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hellomaven --- [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory E:\hellomaven\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hellomaven --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent! [INFO] Compiling 1 source file to E:\hellomaven\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] 不再支持源选项 5。请使用 6 或更高版本。 [ERROR] 不再支持目标选项 1.5。请使用 1.6 或更高版本。 [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.010 s [INFO] Finished at: 2019-02-24T15:12:22+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hellomaven: Compilation failure: Compilation failure: [ERROR] 不再支持源选项 5。请使用 6 或更高版本。 [ERROR] 不再支持目标选项 1.5。请使用 1.6 或更高版本。 [ERROR] -> [Help 1] [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/MojoFailureException
我也试过几次了。说我版本问题,但是我也不知道怎么解决
0
收起
正在回答
3回答
同学在pom.xml文件中增加一下JDK的版本信息:
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.encoding>UTF-8</maven.compiler.encoding> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties>
增加以后再编译试下,如果还有问题,可以再次问题,我们的老师会帮助你解决问题。
祝学习愉快!
蜜蜂仔
2019-02-25 13:32:38
E:\hellomaven>mvn compile [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Malformed POM E:\hellomaven\pom.xml: Unrecognised tag: 'properties' (position: START_TAG seen ...</dependency>-->\r\n\t<properties>... @33:14) @ E:\hellomaven\pom.xml, line 33, column 14 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.imooc.app:hellomaven:1.0-SNAPSHOT (E:\hellomaven\pom.xml) has 1 error [ERROR] Malformed POM E:\hellomaven\pom.xml: Unrecognised tag: 'properties' (position: START_TAG seen ...</dependency>-->\r\n\t<properties>... @33:14) @ E:\hellomaven\pom.xml, line 33, column 14 -> [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 E:\hellomaven>
按照老师你的要求修改后,还是出现错误
Java数据库开发与实战应用2018版
- 参与学习 人
- 提交作业 277 份
- 解答问题 4297 个
Java数据库开发的必备技能,从流行的MySQL数据库开始,到Java原生的数据库管理接口JDBC的使用,再到常用的数据持久化框架MyBatis,让你向Java工程师的目标又迈进了一步!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星