You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stefano Chizzolini (Jira)" <ji...@apache.org> on 2023/02/27 07:44:00 UTC

[jira] [Comment Edited] (MJAVADOC-745) Taglet auto-detection doesn't support transitive dependencies

    [ https://issues.apache.org/jira/browse/MJAVADOC-745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17693825#comment-17693825 ] 

Stefano Chizzolini edited comment on MJAVADOC-745 at 2/27/23 7:43 AM:
----------------------------------------------------------------------

For the purpose, I prepared a fix proposal (see [fix-taglet-autodetect|https://github.com/stechio/maven-javadoc-plugin/tree/fix-taglet-autodetect] branch — because of a regression affecting dependency resolution on current master HEAD (see MJAVADOC-742), I had to temporarily create my branch from the last functioning version (3.4.1); when that regression is solved, I will move my changes to a proper PR branch from master).

My proposal overcomes the severe limitation on topic, replacing the old taglet auto-detection algorithm with an invocation to a robust classpath scanner ([classgraph|https://github.com/classgraph/classgraph]) — I'm not aware if Apache already has its own preferred classpath scanner, neither am I aware which Apache policies apply to the addition of new dependencies (I'm looking forward to your feedback, thanks).

My branch includes a new unit test ({{{}tagletArtifacts-jdk9-test{}}}) and has been successfully verified before commit ({{{}mvn -P run-its verify{}}}).


was (Author: JIRAUSER299015):
For the purpose, I prepared a fix proposal (see [fix-taglet-autodetect|https://github.com/stechio/maven-javadoc-plugin/tree/fix-taglet-autodetect] branch — because of a regression affecting dependency resolution on current master HEAD (see MJAVADOC-742), I had to temporarily create my branch from the last functioning version (3.4.1); when that regression is solved, I will move my changes to a proper PR branch from master).

My proposal overcomes the severe limitation on topic, adding a dependency to a robust classpath scanner ([classgraph|https://github.com/classgraph/classgraph]) — I'm not aware if Apache already has its own preferred classpath scanner, neither am I aware which Apache policies apply to the addition of new dependencies (I'm looking forward to your feedback, thanks).

My branch includes a new unit test ({{{}tagletArtifacts-jdk9-test{}}}) and has been successfully verified before commit ({{{}mvn -P run-its verify{}}}).

> Taglet auto-detection doesn't support transitive dependencies
> -------------------------------------------------------------
>
>                 Key: MJAVADOC-745
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-745
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: javadoc
>    Affects Versions: 3.4.1
>            Reporter: Stefano Chizzolini
>            Priority: Major
>
> The current implementation of the taglet auto-detection algorithm (initial feature request: MJAVADOC-204) doesn't honor the transitive dependency resolution of the configured taglet artifacts (see [<tagletArtifacts/>|https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#tagletArtifacts]): _each artifact on the taglet classpath is scanned separately_ (see [AbstractJavadocMojo.addTagletsFromTagletArtifacts(..)|https://github.com/apache/maven-javadoc-plugin/blob/a5db96e7e16cc432d8fdea05f460f6c3fa258ba9/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L5901] and [JavadocUtil.getTagletClassNames(..)|https://github.com/apache/maven-javadoc-plugin/blob/a5db96e7e16cc432d8fdea05f460f6c3fa258ba9/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java#L721]), _causing taglet class loading to fail in case its hierarchy is spread across multiple artifacts_ (its class loader has visibility only on a single artifact at a time, in the wrong assumption that no intermediate artifact lies between the Taglet interface and its implementations).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)