davidB / yuicompressor-maven-plugin

maven's plugin to compress (Minify / Ofuscate / Aggregate) Javascript files and CSS files using YUI Compressor
http://davidb.github.io/yuicompressor-maven-plugin/
GNU Lesser General Public License v2.1
122 stars 48 forks source link

Remove the assumption of project.basedir that effects multi module maven projects #67

Closed joshuagoodson-wf closed 10 years ago

joshuagoodson-wf commented 10 years ago

When src dir is in different folder than project.basedir, this causes an error because the plugin assumes the src is in the same dir as project.basedir.

vincentmutambuki-wf commented 10 years ago

This would totally eliminate this error. [ERROR] Failed to execute goal net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress (css) on project wf_app_web: Execution css of goal net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress failed: String index out of range: -7 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress (css) on project wf_app_web: Execution css of goal net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress failed: String index out of range: -7 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution css of goal net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress failed: String index out of range: -7 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -7 at java.lang.String.substring(String.java:1937) at java.lang.String.substring(String.java:1904) at net_alchim31_maven_yuicompressor.MojoSupport.processDir(MojoSupport.java:161) at net_alchim31_maven_yuicompressor.MojoSupport.execute(MojoSupport.java:108) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) ... 20 more

davidB commented 10 years ago

Thanks

davidB commented 10 years ago

I deploy version 1.3.3 with your fix, should be available in central repo in 24H

vincentmutambuki-wf commented 10 years ago

Thanks for the speedy turn around.