[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: javadocs links with maven-debian-helper



On 31 August 2017 at 17:03, Carnë Draug <carandraug+dev@gmail.com> wrote:
> Hi
>
> I am packaging some java libraries with maven-debian-helper but having
> problems setting the javadocs links properly.  I have done this for
> ant based projects but I can't figure out how to do it for maven
> projects.
>
> I took a look on a few other *-java-doc packages that are maven only
> projects (libjgoodies-looks-java-doc, libakuma-java, and
> libmetadata-extractor-java-doc) hoping to find the answer.  However,
> they all are linking do docs.oracle.com too instead of the local
> javadocs.  libmetadata-extractor-java-doc on Stretch had the correct
> javadoc links, back when upstream made use of ant and not maven.
>
> I have  tried to set user  property links [1] in  the maven.properties
> file as described in the javadoc plugin documentation but no avail.
>
> How do I set the path for the javadocs of other java libraries when
> using maven-debian-helper?
>
> Thank you
> Carnë
>
> [1] https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#links

Hi

I solved this problem.  The solution is to pass the -link command line
options directly to the javadoc program via the additionalparam
property on the debian.properties file.  Like so [2]:

    additionalparam = -link /usr/share/doc/default-jdk-doc/api/ \
                      -link /usr/share/doc/libcommons-math3-java/api/

This whole problem exists because maven's javadoc plugin, which is
being used to generate the javadocs, ignores the links property when
in offline mode.  This would work fine if using javadoc directly but
the maven plugin adds extra incompatible logic to it.  In addition,
the offlineLinks option seems to only work when extdocURL really is an
external url.  I'm unsure if the problem with offlineLink is a maven
javadoc plugin issue or the javadoc program.

Because the maven plugin is ignore the links option, we have to pass
the flags directly to javadoc with additionalparam.  However, it seems
that additionalparam is deprecated but I see no other alternative to
pass options directly.

Carnë

[2] https://github.com/carandraug/debian-libjlargearrays-java/commit/777a5805082216a86d50cd98bc517ddab1035433


Reply to: