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

Michael Osipov commented on MJAVADOC-794:
-----------------------------------------

Patch and IT welcome!

> Taglet autodetection fails when taglets JAR includes a module-info.class
> ------------------------------------------------------------------------
>
>                 Key: MJAVADOC-794
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-794
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>    Affects Versions: 3.6.3
>            Reporter: Curtis Rueden
>            Priority: Major
>
> Due to a bug in the maven-javadoc-plugin, the following warning gets emitted 
> when a JPMS-modularized artifact containing taglets is included in the 
> javadoc build via a `<tagletArtifact>` tag:
> {{  [WARNING] Unable to auto-detect Taglet class names from}}
> {{  '/path/to/jar.jar'. Try to specify them with <taglets/>.}}
> Running with {{mvn -X}} shows the underlying cause:
> {{  NoClassDefFoundError: module-info is not a}}
> {{  class because access_flag ACC_MODULE is set}}
> Removing the {{module-info.java}} from the component avoids the problem.
> The following patch fixes the problem as of {{{}ded56a90{}}}:
> {{diff --git 
> a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java 
> b/src/main/java/org/apache/maven/plugins/ja>}}
> {{index 835d6332..6e29eadf 100644}}
> {{--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java}}
> {{+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java}}
> {{@@ -904,6 +904,9 @@ public class JavadocUtil {}}
> {{             for (JarEntry jarEntry = jarStream.getNextJarEntry();}}
> {{                     jarEntry != null;}}
> {{                     jarEntry = jarStream.getNextJarEntry()) {}}
> {{+                if ("module-info.class".equals(jarEntry.getName())) {}}
> {{+                    continue;}}
> {{+                }}}
> {{                 Matcher matcher = pattern.matcher(jarEntry.getName());}}
> {{                 if (matcher.matches()) {}}
> {{                     String version = matcher.group("v");}}
>  



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

Reply via email to