alexo / wro4j

New project location is:https://github.com/wro4j/wro4j
442 stars 110 forks source link

Delta check fails if project directory contains "," #207

Open muffl0n opened 10 years ago

muffl0n commented 10 years ago

I had the strange error that, though there were no hashes saved in "build.properties", no css files were generated. After some debugging I found that an exception was logged in ResourceChangeHandler. Unfortunately this error was logged in level debug. I created #206 to change this.

After looking at the exception I quickly found the error: My project directory contains ",". This is because the job in Jenkins is named like this: "Deploy webapp to preview, staging, live". This string is then splitted and produces this error:

[ERROR] failed to check for delta resource: ro.isdc.wro.model.resource.Resource@fabb651[CSS,/scss/print.scss,true].
java.io.IOException: No valid resource '/scss/print.scss' found inside any of contextFolders: [/data/jenkins/workspace/Deploy webapp to preview, staging, live]
        at ro.isdc.wro.model.resource.locator.StandaloneServletContextUriLocator.locate(StandaloneServletContextUriLocator.java:57)
        at ro.isdc.wro.model.resource.locator.factory.InjectableUriLocatorFactoryDecorator.locate(InjectableUriLocatorFactoryDecorator.java:37)
        at ro.isdc.wro.maven.plugin.support.ResourceChangeHandler.isResourceChanged(ResourceChangeHandler.java:82)
        at ro.isdc.wro.maven.plugin.AbstractWro4jMojo.getIncrementalGroupNames(AbstractWro4jMojo.java:336)
        at ro.isdc.wro.maven.plugin.AbstractWro4jMojo.getTargetGroupsAsList(AbstractWro4jMojo.java:295)
        at ro.isdc.wro.maven.plugin.Wro4jMojo.doExecute(Wro4jMojo.java:139)
        at ro.isdc.wro.maven.plugin.AbstractWro4jMojo.execute(AbstractWro4jMojo.java:169)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        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:320)
        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:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        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: java.io.FileNotFoundException: live/src/main/webapp/scss/print.scss (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:131)
        at ro.isdc.wro.model.resource.locator.StandaloneServletContextUriLocator.locateStreamWithContextFolder(StandaloneServletContextUriLocator.java:74)
        at ro.isdc.wro.model.resource.locator.StandaloneServletContextUriLocator.locate(StandaloneServletContextUriLocator.java:49)
        ... 27 more

I'm not exactly sure how to solve this. At least outputting the exception on level error would help others to see that there is something wrong.

muffl0n commented 10 years ago

In #208 I proposed a change to let the build break if ignoreMissingResources is set to false. It ignoreMissingResources it still just outputs an error and let's the build succeed.

alexo commented 9 years ago

@muffl0n This issue has moved to a new repository: https://github.com/wro4j/wro4j/issues/901