Maven javadoc command fails with error "cannot read options"?

21 views Asked by At

In a maven project with build profile, I am using a javadoc-plugin to generate javadoc for my project. The build always fails in goal attach-javadocs with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.6.3:jar (attach-javadocs) on project sample-project: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1
[ERROR] error: cannot read options
[ERROR] Command line was: cmd.exe /X /C "C:\Dev\tools\jdk-17.0.10\bin\javadoc.exe @options @packages"
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Dev\Projects\sample-project\target\apidocs' dir.

As stated in this answer - Why does Maven javadoc fail with error "cannot read options"?, I have a similar problem that some of the other scripts started with CMD always runs in a default %userprofile% directory, although it is started from any other directories.

I tried all the options mentioned there, however there is no way I could resolve this.

The link http://windowsxp.mvps.org/autoruncmd.htm mentioned in the answer is not accessible anymore to fix the default work directory for a command prompt.

0

There are 0 answers