When the maven-resolver and related classes are used with a ClassLoader that doesn't define a java.lang.Package object for the loaded classes, the library throws a NullPointerException.
Scenario: I'm using the maven-resolver classes to resolver artifacts from various repositories. I package the app, and deploy it to a custom environment where the ClassLoader for the app doesn't define a Package for the loaded classes. In these cases, when the maven-resolver library calls this.getClass().getPackage().getImplementationVersion() then a NullPointerException will occurr.
The following classes are affected:
Code around the locations:
This exception makes the library unportable to different environments.
Implement a custom variant of the above classes that circumvent these parts of the code.
Null checks, and hard coding the version number.