HarshMehta112 commented on issue #590:
URL: 
https://github.com/apache/maven-war-plugin/issues/590#issuecomment-3591825797

   @elharo I got your point. We need to add proper checks around all 
mkdir()/mkdirs() calls and throw a MojoExecutionException when directory 
creation fails, ensuring early and clear error reporting instead of 
harder-to-diagnose issues later or incomplete WAR files. The changes remain 
consistent across the plugin and do not affect existing functionality.
   
   Replace calls like `metainfDir.mkdirs();` with explicit checks:
   
   ```java
   if (!metainfDir.exists() && !metainfDir.mkdirs()) {
       throw new MojoExecutionException(
           "Failed to create directory: " + metainfDir.getAbsolutePath());
   }
   ```
   Let me know if I can proceed with a PR. Thanks!


-- 
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