wro4j: Problem with background url in css after aggregation

1. Configure maven plugin:
<cssDestinationFolder>${project.build.directory}/${project.build.finalName}/css/
aggregated</cssDestinationFolder>                
<jsDestinationFolder>${project.build.directory}/${project.build.finalName}/scrip
ts/aggregated</jsDestinationFolder>

wroManagerFactory is YUIStandaloneManagerFactory

2. Create simple css file in 
src/main/webapp/scripts/jquery-myplugin/css/jquery-myplugin.css:
.test {
    background: url(../images/test.gif) no-repeat;
}

3. (Optional) Create an image to 
src/main/webapp/scripts/jquery-myplugin/images/test.gif

4. Create wro.xml in WEB-INF:
<?xml version="1.0" encoding="UTF-8"?>

<groups xmlns="http://www.isdc.ro/wro"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.isdc.ro/wro wro.xsd">

    <group name="all">
        <css>/scripts/jquery-myplugin/css/jquery-myplugin.css</css>
    </group>
</groups>

5. Run mvn package

6. Look at the aggregated css file in 
target/${project.build.finalName}/css/aggregated/all.css

Expected result: 

.test {
    background: url(../../scripts/jquery-myplugin/css/../images/test.gif) no-repeat;
}

but found:

.test {
    background: url(../scripts/jquery-myplugin/css/../images/test.gif) no-repeat;
}

What version of the product are you using? On what operating system?

Wro4j version is 1.3.8.

Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
Java version: 1.6.0_24
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.7" arch: "x86_64" Family: "mac"

Note: When I use just "/css" instead of "/css/aggregated" everything looks fine.

Original issue reported on code.google.com by olga.mel...@gmail.com on 29 Jul 2011 at 3:38

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 17

Most upvoted comments