I am trying to build a project of mine using the javadoc.skip parameter
mvn clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -Pbpfle
But I keep getting an error saying
Unknown life cycle phase ".javadoc.skip=true". You must specify a valid lifecycle phase or a goal in the format
<plugin-prefix>:<goal>
or<plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>
.
I am using Java (JDK) 8 with Maven 3.3.3
Is it an issue with Java because it used to work when I used to work with JDK 7 (and the same version of Maven)? I am running the command in Windows PowerShell.
You need to call mvn javadoc:fix to fix main Java source files (i.e. inside src/main/java directory) or mvn javadoc:test-fix to fix test Java source files (i.e. inside src/test/java directory).
skip Option. The Maven Javadoc plugin has provided a maven. javadoc. skip option to skip the Javadoc generation. Our Maven build won't generate Javadocs if we pass this option with the value true when we build our project: mvn clean install -Dmaven.javadoc.skip=true.
The magic incantation you need is -Xdoclint:none . This goes on the command line invoking Javadoc.
The Javadoc Plugin uses the Javadoc tool to generate javadocs for the specified project. For more information about the standard Javadoc tool, please refer to Reference Guide. The Javadoc Plugin gets the parameter values that will be used from the plugin configuration specified in the pom.
The problem is actually related to how you are launching the Maven command. In Windows Powershell, the dot .
has a special meaning, so it gets interpreted, just like the dash -
.
You will need to escape all those characters using a backtick `
, like so:
mvn clean install `-Dmaven`.javadoc`.skip=true `-Dmaven`.test`.skip=true `-Pbpfle
It seems to work when I replace the
-Dmaven.javadoc.skip=true
with -D maven.javadoc.skip=true
Basically adding a whitespace between the -D and maven. But I thought it wasn't required.
EDIT : This issue was coming up in the Windows powershell only. Adding the whitespaces in the powershell seems to make the command work. In the traditional command prompt, no whitespaces are required and the command works they way I was trying it initially.
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