[ http://jira.codehaus.org/browse/MWAR-12?page=comments#action_59421 ]
Kris Nuttycombe commented on MWAR-12:
-------------------------------------
I like the look of Brian's patch, but one thing I noticed when I attempted to
use it is that there's a possible NullPointerException if the path to the
filter file is incorrectly specified. Here's the diff to fix it:
--- AbstractWarMojo.java.old 2006-02-24 09:39:23.000000000 -0700
+++ AbstractWarMojo.java 2006-02-24 09:46:13.000000000 -0700
@@ -409,10 +409,13 @@
for ( Iterator i = filters.iterator(); i.hasNext(); )
{
- String filtersfile = (String) i.next();
+ String fname = (String) i.next();
+ if (fname == null) throw new MojoExecutionException("Null filter
file specified.");
- Properties properties = PropertyUtils.loadProperties(new
File(filtersfile));
+ File filtersFile = new File(fname);
+ if (!filtersFile.exists()) throw new
MojoExecutionException("Unable to find filters file " + fname);
+ Properties properties = PropertyUtils.loadProperties(filtersFile);
filterProperties.putAll(properties);
}
}
> Add resource filtering to war plugin
> ------------------------------------
>
> Key: MWAR-12
> URL: http://jira.codehaus.org/browse/MWAR-12
> Project: Maven 2.x War Plugin
> Type: Improvement
> Reporter: Mark Hobson
> Assignee: Brett Porter
> Attachments: MWAR-12.patch, test.zip
>
> Original Estimate: 15 minutes
> Remaining: 15 minutes
>
> I'd like to patch the war plugin to perform resource filtering as per the
> resources plugin. This is a trivial patch but would duplicate the following
> code from the resources plugin:
> PropertyUtils
> ReflectionProperties
> ResourcesMojo.copyFile(File, File)
> These look like handy util methods that could be incorporated into
> plexus-utils - what do the developers think?
> Also not sure how resource filtering will be affected by MNG-788.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]