配置 Maven 2 在编译阶段打印出 javac 命令 [英] Config Maven 2 to print out javac commands during compile phase
问题描述
有什么方法可以强制 Maven 2 (>2.0.10) 打印它正在执行的实际 javac 命令.即使我们使用 MAVEN_OPTS 提高了最大值,我们仍然会耗尽内存.我希望能够看到正在执行但内存不足的实际命令.
Is there any way to force Maven 2 (>2.0.10) to print the actual javac commands it's executing. We keep running out of memory even though we've bumped up the max using MAVEN_OPTS. I'd like to be able to see the actual command being executed that is running out of memory.
我已经尝试在 pom 文件的插件管理部分使用下面的详细设置,但这似乎没有给我 javac 命令:
I've tried using the verbose setting below in the pom file's plugin management section but that doesn't seem to give me the javac command:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<maxmem>1024m</maxmem>
<compilerArguments>
<verbose/>
</compilerArguments>
</configuration>
</plugin>
推荐答案
您是否尝试过使用 -X
命令运行 Maven 以打印调试信息?
Have you tried running Maven with the -X
command to print debugging information?
$ mvn -?
...
-X,--debug Produce execution debug output
然后 maven-javac-plugin 应该打印出正在使用的类路径、源目录/路径等.
The maven-javac-plugin should then print out the classpath being used, the source directories/path, etc.
这篇关于配置 Maven 2 在编译阶段打印出 javac 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!