首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Java 9模块测试错误

Java 9模块测试错误
EN

Stack Overflow用户
提问于 2017-09-28 17:01:52
回答 1查看 574关注 0票数 4

我已经用maven编写了Java 9模块应用程序,现在我正在尝试添加测试用例。

当我试图对整个项目进行mvn clean install时,出现了以下错误:

代码语言:javascript
复制
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project EmployeeModule: Fatal error compiling: invalid flag: -Xmodule:EmployeeModule -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :EmployeeModule

这很奇怪,因为我可以在intellij中运行这个项目而没有警告或错误,我也可以在这个模块中运行没有错误的测试。

我正在使用oracle站点的Java 9和Maven 3.5.0。对不起,我不能用java9标记它。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-28 20:23:29

您应该使用maven编译器-plugin 3.7.0 3.6.x是基于模块类的旧定义,因此在使用Java 9时,它们已经变得毫无用处。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46474639

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档