You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brandon Lax <br...@gmail.com> on 2020/10/19 02:03:37 UTC

Using Internal Api's (jdk.javadoc) with Maven

Hi,

I was hoping to get some help with an issue I have been facing relating to the maven-compiler-plugin. I have been using the jdk.javadoc api as part of my project. The code can compile directly (by running javac on the main file), but when trying to build with maven I get error messages that the package jdk.javadoc can not be found. Previously, the solution had been to add the Tools.jar <https://stackoverflow.com/questions/3080437/jdk-tools-jar-as-maven-dependency> file as a dependency, as that jar contained headers for most of the internal apis, but that jar was removed in java 9. Does anyone know of how to setup the compiler plugin to access these internal apis.

Best,
Brandon


Re: Using Internal Api's (jdk.javadoc) with Maven

Posted by Enrico Olivelli <eo...@gmail.com>.
Brandon,
which JDK are you using ?

I have a finding that is related to your issue and probably the solution
will be in common.
While testing the Apache ZooKeeper project in the scope of the Quality
Outreach JDK project I have encountered this issue and we are still
investigating.
https://bugs.openjdk.java.net/browse/JDK-8253996
It is about having jdk.javadoc module available to javac when we are using
maven-compiler-plugin and running javac in the same process as Maven (using
fork=true fixes the problem).
In fact from JDK16+ in order to be able to use -Xdoclint:-missing compiler
argument that jdk.javadoc module must be on the module path, but is it not
present while running Maven (is it because Maven is running with the
classpath and the module path ??)

Adding --add-modules=jdk.javadoc does not help.

I have not raised an issue to maven-compiler-plugin (or plexus compiler or
to Maven core) because the issue is still under triage by JDK team

hope that helps
Enrico


Il giorno lun 19 ott 2020 alle ore 07:27 Brandon Lax <br...@gmail.com>
ha scritto:

> Hi,
>
> I was hoping to get some help with an issue I have been facing relating to
> the maven-compiler-plugin. I have been using the jdk.javadoc api as part of
> my project. The code can compile directly (by running javac on the main
> file), but when trying to build with maven I get error messages that the
> package jdk.javadoc can not be found. Previously, the solution had been to
> add the Tools.jar <
> https://stackoverflow.com/questions/3080437/jdk-tools-jar-as-maven-dependency>
> file as a dependency, as that jar contained headers for most of the
> internal apis, but that jar was removed in java 9. Does anyone know of how
> to setup the compiler plugin to access these internal apis.
>
> Best,
> Brandon
>
>