I have a Maven project which compiles JavaFX 8 application. Can you tell me how I can display detailed output during compile time? Usually this is done by -X argument but I want to configure this into the POM file.
You can use the configuration of the maven-compiler-plugin to add such supplemental arguments like this:
<project>
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerArgs>
<arg>-Xmaxerrs=1000</arg>
<arg>-Xlint</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
</project>
Furthermore you can use the verbose option to enhance the output like this:
<project>
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<verbose>true</verbose>
..
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
...
</project>
In addition to khmarbaise's answer:
-X
compiler parameters that require values (eg. -Xmaxwarns
) need to be passed to a separate <arg>
tag.
Example:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Xmaxwarns</arg>
<arg>50000</arg>
</compilerArgs>
</configuration>
</plugin>
Tested with:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With