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/09/11 19:16:55 UTC

(maven-doap-plugin) 01/02: Drop plexus ReaderFactory/WriterFactory and the dead blacklist check

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

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

commit d1b2d773e32b30f2350bcccdaa1f2cd29d482fd2
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Fri Sep 11 21:11:08 2026 +0200

    Drop plexus ReaderFactory/WriterFactory and the dead blacklist check
    
    ReaderFactory.newXmlReader(File)/WriterFactory.newXmlWriter(File) are
    deprecated thin wrappers around XmlStreamReader/XmlStreamWriter (both
    already on the classpath via plexus-xml); calling the constructors
    directly is a drop-in replacement.
    
    ArtifactRepository.isBlacklisted() is deprecated and, per javap on
    maven-core 3.9.16's two runtime implementations
    (MavenArtifactRepository and LegacyLocalRepositoryManager's adapter),
    hardcoded to return false, so the check in writeReleases() never
    skips a repository. Removed rather than replaced.
---
 src/main/java/org/apache/maven/plugin/doap/DoapMojo.java | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java b/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
index 657e11d..1089fda 100644
--- a/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
+++ b/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
@@ -74,11 +74,11 @@ import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.i18n.I18N;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.WriterFactory;
 import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
 import org.codehaus.plexus.util.xml.XMLWriter;
+import org.codehaus.plexus.util.xml.XmlStreamReader;
+import org.codehaus.plexus.util.xml.XmlStreamWriter;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.eclipse.aether.RepositorySystem;
 import org.eclipse.aether.RepositorySystemSession;
@@ -546,7 +546,7 @@ public class DoapMojo extends AbstractMojo {
                 FileUtils.mkdir(outputFile.getParentFile().getAbsolutePath());
             }
 
-            w = WriterFactory.newXmlWriter(outputFile);
+            w = new XmlStreamWriter(outputFile);
         } catch (IOException e) {
             throw new MojoExecutionException("Error creating DOAP file " + outputFile.getAbsolutePath(), e);
         }
@@ -1333,9 +1333,6 @@ public class DoapMojo extends AbstractMojo {
         Metadata metadata = null;
 
         for (ArtifactRepository repo : remoteRepositories) {
-            if (repo.isBlacklisted()) {
-                continue;
-            }
             if (repo.getSnapshots().isEnabled()) {
                 continue;
             }
@@ -1466,7 +1463,7 @@ public class DoapMojo extends AbstractMojo {
             return null;
         }
 
-        try (Reader reader = ReaderFactory.newXmlReader(file)) {
+        try (Reader reader = new XmlStreamReader(file)) {
             return new MetadataXpp3Reader().read(reader, false);
         } catch (IOException | XmlPullParserException e) {
             throw new MojoExecutionException(