[ 
https://issues.apache.org/jira/browse/MJAVADOC-794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Curtis Rueden updated MJAVADOC-794:
-----------------------------------
    Description: 
Due to a bug in the maven-javadoc-plugin, the following warning gets emitted 
with 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");}}

 

  was:
Due to a bug in the maven-javadoc-plugin, the following warning gets
emitted with the scijava-taglets artifact included in the javadoc build:

  [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 scijava-taglets's module-info.java avoids the problem.


> 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 
> with 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