Resurrecting this thread because I'm having this same issue. I'm using build 1.6.3 of the plugin and it's still writing the URL's wrong only on Mac & Linux systems. Windows (my local) works fine, but *nix based systems add way too many ../ items to the url()... like so:My windows build:url(../style/images/default.png)Remote linux build / A buddy's Mac local build:url(../../../../style/images/default.png)Here's my configuration:<groupId>ro.isdc.wro4j</groupId><artifactId>wro4j-maven-plugin</artifactId><version>1.6.3</version><configuration><minimize>true</minimize><cssDestinationFolder>${project.build.directory}/classes/jcr_root/include/style</cssDestinationFolder><jsDestinationFolder>${project.build.directory}/classes/jcr_root/include/script</jsDestinationFolder><contextFolder>${basedir}/src/main/content/jcr_root/include/</contextFolder><wroFile>${basedir}/wro.xml</wroFile><wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory><extraConfigFile>${basedir}/wro.properties</extraConfigFile><ignoreMissingResources>false</ignoreMissingResources></configuration>Just like the original posted, if I change the cssDestinationFolder to the source directory it works fine and all the url's come out as ../style. <cssDestinationFolder>${basedir}/src/main/content/jcr_root/include/style</cssDestinationFolder> That's what I'm using now, but it's certainly not ideal. None of these get 'cleaned' and they essentially need 2 builds before it's actually updated in the web directory.Can you see anything in my config that I have setup wrong? Need any further information? Any help would be greatly apreciated, it's a large code structure and I'd REALLY rather not have to change all my CSS image references to root relative URLs to fix this (over 1000 changes in that case)
Even at the very first wro group the problem arises. Here's the scenario:- Web root for CSS is /include/- As you see above, here's my root reference in the pom.xml<cssDestinationFolder>${project.build.directory}/classes/jcr_root/include/style</cssDestinationFolder> (this is effectively the "target" directory and then the folders below it where it needs to be to mach the web root)
<contextFolder>${basedir}/src/main/content/jcr_root/include/</contextFolder>
- Example CSS file for themes: /include/style/light.css- light.css imports it's accompanying jQuery theme: @import url(theme/light/jquery-ui.css); (so this location is effectively /include/style/theme/light/jquery-ui.css just for reference)- Example URL call inside jquery-ui.css: background: url(images/ui-bg_glass_55_fbf9ee_1x400.png) ; (so this location is effectively /include/style/theme/light/images/ui-bg_glass_55_fbf9ee_1x400.png just for reference)one example group from wro.xml:<group name="light-compressed"><css>/style/light.css</css></group>wro.properties:preProcessors=cssUrlRewriting,semicolonAppender,cssImport,jsMin,yuiCssMin(this is used for JS as well so that's why you'll see things like jsMin)So in the above scenario on Windows boxes' the CSS gets compiled into /include/style/light-compressed.css and the image is referenced as such:background: url(../style/theme/light/images/ui-bg_glass_55_fbf9ee_1x400.png);But on a Mac or Linux:background: url(../../../../style/theme/light/images/ui-bg_glass_55_fbf9ee_1x400.png);I can tell it's trying to compensate for the difference in directories between the contextFolder folder and the cssDestinationFolder folder, but why it gets it wrong on a Mac / Linux is confusing.Hopefully this gives you a good idea of the scenario. Please let me know if you have any ideas or need anything else.