我正在使用Maven和Eclipse编译器。这是配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>jdt</compilerId>
<skipMain>${skip.sources.compilation.with.javac}</skipMain>
<skip>${skip.test.sources.compilation.with.javac}</skip>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<source>${compiler.level}</source>
<target>${compiler.level}</target>
<optimize>${compiler.optimize}</optimize>
<debug>${compiler.debug}</debug>
<debuglevel>${compiler.debug.level}</debuglevel>
<meminitial>512m</meminitial>
<maxmem>1024m</maxmem>
<compilerArgs>
<arg>-showversion</arg>
</compilerArgs>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
<version>0.22.0</version>
</dependency>
</dependencies>
</plugin>
我想打印有关当前使用的编译器的信息,因为&#39; compilerId&#39;标签有时可以从配置中删除。 出于这些目的,我已添加:
<compilerArgs>
<arg>-showversion</arg>
</compilerArgs>
......如上例所示。
但它不起作用......
[INFO] --- maven-compiler-plugin:3.1:compile(default-compile)@ MvnExample ---
[INFO]将12个源文件编译为C:\ Java \ MvnExample \ target \ classes
您对如何实现它有任何想法吗?