Summary
execute() calls configureLocator() before the try block that contains the validation and resource processing, so any runtime exception it throws is not wrapped and escapes untyped.
src/main/java/org/apache/maven/plugin/resources/remote/AbstractProcessRemoteResourcesMojo.java:429-433
configureLocator();
ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
try {
validate();
...
configureLocator() at :482-507 dereferences project.getFile().getParentFile():
locator.addSearchPath(FileResourceLoader.ID, project.getFile().getParentFile().getAbsolutePath());
If the current project has no associated POM file (project.getFile() null — possible for models built without a file, super POMs, or stubs), this throws a raw NullPointerException instead of a MojoExecutionException. The rest of execute() deliberately wraps work in the try/finally (which also restores the thread context classloader) precisely to contain such failures.
Suggested fix
Move configureLocator() inside the guarded try, and/or null-guard project.getFile() in configureLocator() with a clear error message.
Summary
execute()callsconfigureLocator()before thetryblock that contains the validation and resource processing, so any runtime exception it throws is not wrapped and escapes untyped.src/main/java/org/apache/maven/plugin/resources/remote/AbstractProcessRemoteResourcesMojo.java:429-433configureLocator()at:482-507dereferencesproject.getFile().getParentFile():If the current project has no associated POM file (
project.getFile()null — possible for models built without a file, super POMs, or stubs), this throws a rawNullPointerExceptioninstead of aMojoExecutionException. The rest ofexecute()deliberately wraps work in thetry/finally(which also restores the thread context classloader) precisely to contain such failures.Suggested fix
Move
configureLocator()inside the guardedtry, and/or null-guardproject.getFile()inconfigureLocator()with a clear error message.