是否有可能让maven接受其编译器插件的maxerrs? [英] Is it possible to get maven to accept maxerrs for its compiler plugin?
问题描述
我有一个项目,我负责修复一些错误,另一个开发人员负责其他错误。错误的数量已超过一百,而且由于我正在修复我的错误,她的错误堆积如山。我正处于我看到她的99个错误和我的错误的地步,我想我很快就会达到她的100个错误。我调查了maven使用这个配置:
I have a project where I am responsible for fixing some errors and another developer is responsible for other errors. The number of errors is well over a hundred, and as I'm fixing my errors, her errors are piling up. I'm at the point where I see 99 of her errors and one of mine, and I assume I will soon get to a point where it is 100 of hers. I looked into using this configuration for maven:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-Xmaxerrs 1000</compilerArgument>
</configuration>
</plugin>
但没有骰子:
Failure executing javac, but could not parse the error:
javac: invalid flag: -Xmaxerrs 1000
Usage: javac <options> <source files>
use -help for a list of possible options
在使用javac的命令行中, maxerrs flag按预期工作,但我似乎无法与它实现跨越。
On the command line using javac, the maxerrs flag works as expected, but I can't seem to make the leap to maven with it.
任何想法?
推荐答案
使用地图语法对我有用:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<fork>true</fork>
<compilerArguments>
<Xmaxerrs>1000</Xmaxerrs>
</compilerArguments>
</configuration>
</plugin>
该选项按预期传递:
$ mvn clean compile -X
...
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [/home/pascal/Projects/stackoverflow/Q3358242/src/main/java]
[DEBUG] Classpath: [/home/pascal/Projects/stackoverflow/Q3358242/target/classes]
[DEBUG] Output directory: /home/pascal/Projects/stackoverflow/Q3358242/target/classes
[DEBUG] Classpath:
[DEBUG] /home/pascal/Projects/stackoverflow/Q3358242/target/classes
[DEBUG] Source roots:
[DEBUG] /home/pascal/Projects/stackoverflow/Q3358242/src/main/java
[DEBUG] Command line options:
[DEBUG] -d /home/pascal/Projects/stackoverflow/Q3358242/target/classes -classpath /home/pascal/Projects/stackoverflow/Q3358242/target/classes: -sourcepath /home/pascal/Projects/stackoverflow/Q3358242/src/main/java: /home/pascal/Projects/stackoverflow/Q3358242/src/main/java/com/stackoverflow/q3358242/App.java -g -nowarn -target 1.5 -source 1.5 -encoding UTF-8 -Xmaxerrs 1000
[INFO] Compiling 1 source file to /home/pascal/Projects/stackoverflow/Q3358242/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
...
奇怪的是我得到完全相同的调试输出(使用完全相同的命令行选项)使用您提供的备用配置时...除非由于执行javac失败而失败。你应该提出一个 Jira问题,肯定有些奇怪。
The odd part is that I get the exact same debug output (with the exact same Command line options) when using the alternative configuration you provided... except that it fails due to a Failure executing javac. You should raise a Jira issue, there is definitely something weird.
这篇关于是否有可能让maven接受其编译器插件的maxerrs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!