You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/08/09 14:00:15 UTC

(maven-plugin-tools) 04/08: MPLUGIN-421: Remove direct QDox dependency

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git

commit 82c7b84feedf7bf37944bc2a8c871be803fb049e
Author: Vaclav Haisman <vh...@gmail.com>
AuthorDate: Fri Aug 7 22:27:16 2026 +0200

    MPLUGIN-421: Remove direct QDox dependency
---
 .../src/it/gh-944-exclude-source-directory/pom.xml |  6 +++---
 .../maven/plugin/coreit/SomeGeneratedModel.java    |  2 --
 .../SomeGeneratedModel.java => verify.groovy}      | 23 +++++++++------------
 .../javaparser-generated-source/invoker.properties | 18 ++++++++++++++++
 .../pom.xml                                        | 16 ++++-----------
 .../org/apache/maven/plugin/coreit/FirstMojo.java} | 24 ++++++++++++----------
 .../maven/plugin/coreit/SomeGeneratedModel.java    |  2 --
 maven-plugin-tools-annotations/pom.xml             |  4 ----
 .../JavadocBlockTagsToXhtmlConverter.java          |  5 -----
 pom.xml                                            |  5 -----
 src/site/resources/images/plugin-tools-deps.svg    | 10 ++++-----
 11 files changed, 53 insertions(+), 62 deletions(-)

diff --git a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml b/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml
index 2668f85d..cdee0e30 100644
--- a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml
+++ b/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml
@@ -29,7 +29,7 @@ under the License.
 
   <name>Maven Integration Test :: gh-944-exclude-source-directory</name>
   <description>
-    Test plugin-plugin, plugin.xml descriptor - shouldn't contain explicitly excluded source directories
+      Test plugin-plugin, plugin.xml descriptor - shouldn't contain explicitly excluded source directories
   </description>
 
   <properties>
@@ -96,8 +96,8 @@ under the License.
         <version>@project.version@</version>
         <configuration>
           <excludedScanDirectories>
-            <!-- Example that is excluded to avoid https://github.com/paul-hammant/qdox/issues/287 -->
-            <excludedScanDirectory>${project.build.directory}/generated-sources/annotations</excludedScanDirectory>
+            <!-- Exclude the source root containing FirstMojo's Javadoc so the exclusion is observable. -->
+            <excludedScanDirectory>${project.basedir}/src/main/java</excludedScanDirectory>
           </excludedScanDirectories>
           <goalPrefix>prefix</goalPrefix>
         </configuration>
diff --git a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java b/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
index c5290edd..50f6463c 100644
--- a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
+++ b/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
@@ -27,8 +27,6 @@ import org.jspecify.annotations.Nullable;
 @Immutable
 @Modifiable
 public interface SomeGeneratedModel {
-    // Triggers https://github.com/paul-hammant/qdox/issues/287 on the generated code when QDox tries
-    // to scan it.
     @Nullable
     List<@Nullable String> getThings();
 }
diff --git a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java b/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/verify.groovy
similarity index 65%
copy from maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
copy to maven-plugin-plugin/src/it/gh-944-exclude-source-directory/verify.groovy
index c5290edd..41dd1b13 100644
--- a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
+++ b/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/verify.groovy
@@ -16,19 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.maven.plugin.coreit;
 
-import java.util.List;
+import groovy.xml.XmlParser
 
-import org.immutables.value.Value.Immutable;
-import org.immutables.value.Value.Modifiable;
-import org.jspecify.annotations.Nullable;
+File descriptorFile = new File(basedir, "target/classes/META-INF/maven/plugin.xml")
+assert descriptorFile.isFile()
 
-@Immutable
-@Modifiable
-public interface SomeGeneratedModel {
-    // Triggers https://github.com/paul-hammant/qdox/issues/287 on the generated code when QDox tries
-    // to scan it.
-    @Nullable
-    List<@Nullable String> getThings();
-}
+def pluginDescriptor = new XmlParser().parse(descriptorFile)
+def mojo = pluginDescriptor.mojos.mojo.find { it.goal.text() == "first" }
+
+assert mojo != null
+assert mojo.description.text() == ""
+
+return true
diff --git a/maven-plugin-plugin/src/it/javaparser-generated-source/invoker.properties b/maven-plugin-plugin/src/it/javaparser-generated-source/invoker.properties
new file mode 100644
index 00000000..2f680d3f
--- /dev/null
+++ b/maven-plugin-plugin/src/it/javaparser-generated-source/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = process-classes
diff --git a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml b/maven-plugin-plugin/src/it/javaparser-generated-source/pom.xml
similarity index 80%
copy from maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml
copy to maven-plugin-plugin/src/it/javaparser-generated-source/pom.xml
index 2668f85d..bc7beb74 100644
--- a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/pom.xml
+++ b/maven-plugin-plugin/src/it/javaparser-generated-source/pom.xml
@@ -22,15 +22,13 @@ under the License.
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <groupId>org.apache.maven.its.gh-944-exclude-source-directory</groupId>
-  <artifactId>gh-944-exclude-source-directory</artifactId>
+  <groupId>org.apache.maven.its.javaparser-generated-source</groupId>
+  <artifactId>javaparser-generated-source</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
-  <name>Maven Integration Test :: gh-944-exclude-source-directory</name>
-  <description>
-    Test plugin-plugin, plugin.xml descriptor - shouldn't contain explicitly excluded source directories
-  </description>
+  <name>Maven Integration Test :: JavaParser Generated Source</name>
+  <description>Checks that JavaParser scans generated sources containing type-use annotations.</description>
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -51,7 +49,6 @@ under the License.
       <scope>provided</scope>
     </dependency>
 
-    <!-- Dependencies that are needed for the original bug reproduction -->
     <dependency>
       <groupId>org.immutables</groupId>
       <artifactId>value</artifactId>
@@ -95,14 +92,9 @@ under the License.
         <artifactId>maven-plugin-plugin</artifactId>
         <version>@project.version@</version>
         <configuration>
-          <excludedScanDirectories>
-            <!-- Example that is excluded to avoid https://github.com/paul-hammant/qdox/issues/287 -->
-            <excludedScanDirectory>${project.build.directory}/generated-sources/annotations</excludedScanDirectory>
-          </excludedScanDirectories>
           <goalPrefix>prefix</goalPrefix>
         </configuration>
       </plugin>
     </plugins>
-
   </build>
 </project>
diff --git a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java b/maven-plugin-plugin/src/it/javaparser-generated-source/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
similarity index 68%
copy from maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
copy to maven-plugin-plugin/src/it/javaparser-generated-source/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
index c5290edd..df868e1e 100644
--- a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
+++ b/maven-plugin-plugin/src/it/javaparser-generated-source/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java
@@ -18,17 +18,19 @@
  */
 package org.apache.maven.plugin.coreit;
 
-import java.util.List;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 
-import org.immutables.value.Value.Immutable;
-import org.immutables.value.Value.Modifiable;
-import org.jspecify.annotations.Nullable;
+/** A Mojo that uses the generated model. */
+@Mojo(name = "first")
+public class FirstMojo extends AbstractMojo {
 
-@Immutable
-@Modifiable
-public interface SomeGeneratedModel {
-    // Triggers https://github.com/paul-hammant/qdox/issues/287 on the generated code when QDox tries
-    // to scan it.
-    @Nullable
-    List<@Nullable String> getThings();
+    @Parameter
+    private ModifiableSomeGeneratedModel model;
+
+    @Override
+    public void execute() {
+        // Nothing to do.
+    }
 }
diff --git a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java b/maven-plugin-plugin/src/it/javaparser-generated-source/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
similarity index 90%
copy from maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
copy to maven-plugin-plugin/src/it/javaparser-generated-source/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
index c5290edd..50f6463c 100644
--- a/maven-plugin-plugin/src/it/gh-944-exclude-source-directory/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
+++ b/maven-plugin-plugin/src/it/javaparser-generated-source/src/main/java/org/apache/maven/plugin/coreit/SomeGeneratedModel.java
@@ -27,8 +27,6 @@ import org.jspecify.annotations.Nullable;
 @Immutable
 @Modifiable
 public interface SomeGeneratedModel {
-    // Triggers https://github.com/paul-hammant/qdox/issues/287 on the generated code when QDox tries
-    // to scan it.
     @Nullable
     List<@Nullable String> getThings();
 }
diff --git a/maven-plugin-tools-annotations/pom.xml b/maven-plugin-tools-annotations/pom.xml
index 8753d2c1..0b6fb6b0 100644
--- a/maven-plugin-tools-annotations/pom.xml
+++ b/maven-plugin-tools-annotations/pom.xml
@@ -96,10 +96,6 @@
       <groupId>org.jsoup</groupId>
       <artifactId>jsoup</artifactId>
     </dependency>
-    <dependency>
-      <groupId>com.thoughtworks.qdox</groupId>
-      <artifactId>qdox</artifactId>
-    </dependency>
     <dependency>
       <groupId>com.github.javaparser</groupId>
       <artifactId>javaparser-symbol-solver-core</artifactId>
diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavadocBlockTagsToXhtmlConverter.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavadocBlockTagsToXhtmlConverter.java
index 327f67f7..88454109 100644
--- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavadocBlockTagsToXhtmlConverter.java
+++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavadocBlockTagsToXhtmlConverter.java
@@ -24,7 +24,6 @@ import javax.inject.Singleton;
 
 import java.util.Map;
 
-import com.thoughtworks.qdox.model.DocletTag;
 import org.apache.maven.tools.plugin.extractor.annotations.converter.tag.block.JavadocBlockTagToHtmlConverter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,10 +51,6 @@ public class JavadocBlockTagsToXhtmlConverter {
         this.blockTagConverters = blockTagConverters;
     }
 
-    public String convert(DocletTag docletTag, ConverterContext context) {
-        return convert(docletTag.getName(), docletTag.getValue(), context);
-    }
-
     public String convert(String name, String text, ConverterContext context) {
         JavadocBlockTagToHtmlConverter converter = blockTagConverters.get(name);
         if (converter == null) {
diff --git a/pom.xml b/pom.xml
index 9ca5ab55..b438e976 100644
--- a/pom.xml
+++ b/pom.xml
@@ -235,11 +235,6 @@
         <version>2.4.1</version>
       </dependency>
 
-      <dependency>
-        <groupId>com.thoughtworks.qdox</groupId>
-        <artifactId>qdox</artifactId>
-        <version>2.2.0</version>
-      </dependency>
       <dependency>
         <groupId>com.github.javaparser</groupId>
         <artifactId>javaparser-symbol-solver-core</artifactId>
diff --git a/src/site/resources/images/plugin-tools-deps.svg b/src/site/resources/images/plugin-tools-deps.svg
index d0c2747c..448bb3be 100644
--- a/src/site/resources/images/plugin-tools-deps.svg
+++ b/src/site/resources/images/plugin-tools-deps.svg
@@ -69,11 +69,11 @@
    </a>
   </g>
   <g>
-   <path fill="none" d="M14399 4698h1719v812h-1719z"/>
-   <a target="_parent" xlink:href="https://github.com/paul-hammant/qdox">
-    <path fill="#FF9" d="M15258 5508h-858v-809h1716v809z"/>
-    <path fill="none" stroke="#000" d="M15258 5508h-858v-809h1716v809z"/>
-    <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Arial, sans-serif" font-size="494" font-weight="400"><tspan x="14721" y="5275" class="TextPosition"><tspan style="white-space:pre">qdox</tspan></tspan></tspan></text>
+   <path fill="none" d="M13999 4698h2519v812h-2519z"/>
+   <a target="_parent" xlink:href="https://javaparser.org/">
+    <path fill="#FF9" d="M15258 5508h-1258v-809h2516v809z"/>
+    <path fill="none" stroke="#000" d="M15258 5508h-1258v-809h2516v809z"/>
+    <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Arial, sans-serif" font-size="494" font-weight="400"><tspan x="14073" y="5275" class="TextPosition"><tspan style="white-space:pre">JavaParser</tspan></tspan></tspan></text>
    </a>
   </g>
   <g>