I'm writing a Jenkins plugin but am new to both Java and Maven.
When I build the plugin in intelliJ I get all of the compiler warnings I expect to see (deprecation warnings for example) but I can't find a way to compile via the command line that will show these (eg with mvn hpi:hpi / mvn compile)
I've tried adding the following lines to the maven-compiler-plugin section of a Maven settings file but to no avail:
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
The ultimate aim of this is to compile the plugin on jenkins and feed the warnings into the warnings plugin.
Two suggestions you can try:
1) Add the compiler-argument -Xlint:all:
2.) Try passing the arguments via command line like this:
Good Luck!
Based on TimHauschildt's answer, I had to modify my jenkins pom.xml file to look like this:
Then ran
mvn compile
. After that the warnings plugin in Jenkins could pick up the warnings.The
-Dmaven.compiler.showDeprecation=true
option also worked well, but the amount of output varied depending on what version of the compiler plugin jenkins/maven chose by default.