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

sjaranowski pushed a commit to branch io-exception-chek-source
in repository https://gitbox.apache.org/repos/asf/maven-dist-tool.git

commit 4ee4734a44535fcc5c17fc7223aded485bdb7cd8
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Sat Nov 8 15:26:43 2025 +0100

    Avoid break build on IOException in check-source-release report
    
    When IOException occurs we cen continue to generating report instead of 
stop whole build
---
 .../tools/source/DistCheckSourceReleaseReport.java    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseReport.java
 
b/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseReport.java
index 4648a44..8ecf658 100644
--- 
a/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseReport.java
+++ 
b/src/main/java/org/apache/maven/dist/tools/source/DistCheckSourceReleaseReport.java
@@ -455,20 +455,22 @@ public class DistCheckSourceReleaseReport extends 
AbstractDistCheckReport {
      * @param cli
      * @param version
      * @return missing files
-     * @throws IOException
      */
-    private List<String> checkDirectoryIndex(String url, ConfigurationLineInfo 
cli, String version, boolean dist)
-            throws IOException {
+    private List<String> checkDirectoryIndex(String url, ConfigurationLineInfo 
cli, String version, boolean dist) {
         Set<String> retrievedFiles = new HashSet<>();
-        Elements links = selectLinks(url);
-        for (Element e : links) {
-            retrievedFiles.add(e.attr("href"));
+        List<String> missingFiles = new ArrayList<>();
+
+        try {
+            Elements links = selectLinks(url);
+            for (Element e : links) {
+                retrievedFiles.add(e.attr("href"));
+            }
+        } catch (IOException e) {
+            missingFiles.add(url + ": " + e.getMessage());
         }
 
         String sourceReleaseFilename = cli.getSourceReleaseFilename(version, 
dist);
 
-        List<String> missingFiles = new ArrayList<>();
-
         // require source release file
         if (!retrievedFiles.contains(sourceReleaseFilename)) {
             missingFiles.add(sourceReleaseFilename);
@@ -491,7 +493,6 @@ public class DistCheckSourceReleaseReport extends 
AbstractDistCheckReport {
             }
             if (error) {
                 getLog().warn("==> when reading " + url + " got following 
hrefs: " + retrievedFiles);
-                getLog().warn(url + " = " + read(url));
             }
         }
 

Reply via email to