我已经用maven编写了Java 9模块应用程序,现在我正在尝试添加测试用例。
当我试图对整个项目进行mvn clean install时,出现了以下错误:
[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标记它。
发布于 2017-09-28 20:23:29
您应该使用maven编译器-plugin 3.7.0 3.6.x是基于模块类的旧定义,因此在使用Java 9时,它们已经变得毫无用处。
https://stackoverflow.com/questions/46474639
复制相似问题