If you use resources plugin and in css files you do have uri-s with attributes (after the ?) or with # the output uri-s will not be calculated correctly. This is because resource plugin checks if file with the given uri exists in file system without extracting clean uri (without attributes).
For example you can have following declaration in your css file (part of font-awesome):
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot'); /* IE9 */
src: url('../fonts/fontawesome-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/fontawesome-webfont.woff') format('woff'), /* Modern browser */
url('../fonts/fontawesome-webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/fontawesome-webfont.svg?#fontawesomeregular') format('svg'); /* Legacy iOS */
font-weight: normal;
font-style: normal;
}
The solution:
- In your grails-app add resourceMappers folder
- Add new class CSSFontsRewriterResourceMapper.groovy to resourceMappers folder
- Rebuild your project