elharo opened a new issue, #1614:
URL: https://github.com/apache/maven-dependency-plugin/issues/1614

   ## Problem
   
   Two catch blocks in `getModuleDescriptor()` silently ignore exceptions when 
extracting module descriptors:
   
   ```java
   } catch (IOException e) {
       // noop  <-- IOException silently swallowed
   }
   
   } catch (ClassNotFoundException | SecurityException | IllegalAccessException 
| IllegalArgumentException e) {
       // do nothing  <-- Multiple exceptions silently ignored
   }
   ```
   
   These swallowed exceptions hide errors when reading manifest files or using 
reflection to access Java 9+ module APIs, making it difficult to diagnose 
module descriptor extraction failures.
   
   ## Fix
   
   At minimum, log the exceptions at debug level:
   
   ```java
   } catch (IOException e) {
       getLog().debug("Failed to read manifest from " + artifactFile + ": " + 
e.getMessage());
   }
   
   } catch (ClassNotFoundException | SecurityException | IllegalAccessException 
| IllegalArgumentException e) {
       getLog().debug("Failed to extract module descriptor using reflection: " 
+ e.getMessage());
   }
   ```
   
   ## File
   
   
`src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java:304-311`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to