Problem
Two catch blocks in getModuleDescriptor() silently ignore exceptions when extracting module descriptors:
} 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:
} 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
Problem
Two catch blocks in
getModuleDescriptor()silently ignore exceptions when extracting module descriptors: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:
File
src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java:304-311