Sounds like an issue worth registrating at Jira.IMHO for this case it's very
easy to write a test. -Robert From: [email protected]
To: [email protected]
Date: Sun, 29 Jan 2012 22:48:45 -0600
Subject: [mojo-scm] [15819]
trunk/mojo/webminifier-maven-plugin/src/main/java/org/codehaus/mojo
/webminifier/WebMinifierMojo.java: Fixed a bug where if any part of the path
had a .js in it, then the first instance would be replaced with -min.js.
[15819]
trunk/mojo/webminifier-maven-plugin/src/main/java/org/codehaus/mojo/webminifier/WebMinifierMojo.java:
Fixed a bug where if any part of the path had a .js in it, then the first
instance would be replaced with -min.js.
Revision 15819
Author huntc
Date 2012-01-29 22:48:45 -0600 (Sun, 29 Jan 2012)
Log Message
Fixed a bug where if any part of the path had a .js in it, then the first
instance would be replaced with -min.js. It is actually possible for a path to
have .js in it given that a project may be named xyz.js.
Modified Paths
trunk/mojo/webminifier-maven-plugin/src/main/java/org/codehaus/mojo/webminifier/WebMinifierMojo.java
Diff
Modified:
trunk/mojo/webminifier-maven-plugin/src/main/java/org/codehaus/mojo/webminifier/WebMinifierMojo.java
(15818 => 15819)
---
trunk/mojo/webminifier-maven-plugin/src/main/java/org/codehaus/mojo/webminifier/WebMinifierMojo.java
2012-01-30 00:01:01 UTC (rev 15818)
+++
trunk/mojo/webminifier-maven-plugin/src/main/java/org/codehaus/mojo/webminifier/WebMinifierMojo.java
2012-01-30 04:48:45 UTC (rev 15819)
@@ -414,8 +414,18 @@
File minifiedJSResource;
try
{
- minifiedJSResource = FileUtils.toFile( //
- new URL(
concatenatedJsResource.toURI().toString().replace( ".js", "-min.js" ) ) );
+ String uri = concatenatedJsResource.toURI().toString();
+ int i = uri.lastIndexOf( ".js" );
+ String minUri;
+ if ( i > -1 )
+ {
+ minUri = uri.substring( 0, i ) + "-min.js";
+ }
+ else
+ {
+ minUri = uri;
+ }
+ minifiedJSResource = FileUtils.toFile( new URL( minUri
) );
}
catch ( MalformedURLException e )
{
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email