grails / grails-maven

67 stars 52 forks source link

Multi-module POM - target/assets direectory is created in the project root #68

Open kvsankar opened 9 years ago

kvsankar commented 9 years ago

My maven project has multiple modules. One of them is a Grails project which uses the grails-maven-plugin. I noticed a difference between versions 2.4.4 and 2.4.3.

2.4.4 behavior - When mvn install tries to build the WAR file, the assets pipeline plugin tries to pre-compile the assets. These are put into $PROJECTROOT/target/assets instead of $PROJECTROOT/grailsModule/target/assets. Here's the relevant snippet from the build output:

|Building WAR file
........................................................................
|Precompiling Assets!
|Processing File 1 of 8 - bootstrap.min.js
|Compressing File 1 of 8 - bootstrap.min
|Processing File 2 of 8 - jquery.1.8.3.min.js
|Compressing File 2 of 8 - jquery.1.8.3.min
|Processing File 3 of 8 - bootstrap.min.css
|Compressing File 3 of 8 - bootstrap.min
|Processing File 4 of 8 - platformTools.css
|Minifying File 4 of 8 - platformTools
|Compressing File 4 of 8 - platformTools
|Processing File 5 of 8 - jquery.js
|Uglifying File 5 of 8 - jquery
|Compressing File 5 of 8 - jquery
|Processing File 6 of 8 - jquery/jquery-1.11.1.js
|Uglifying File 6 of 8 - jquery/jquery-1.11.1
|Compressing File 6 of 8 - jquery/jquery-1.11.1
|Processing File 7 of 8 - jquery/jquery-1.11.1.min.js
|Compressing File 7 of 8 - jquery/jquery-1.11.1.min
|Processing File 8 of 8 - jquery/jquery-1.11.1.min.map
|Compressing File 8 of 8 - jquery/jquery-1.11.1.min
|Finished Precompiling Assets
..Error
|
WAR packaging error: /path/to/project/grailsmodule/target/assets does not exist.

The directory target/assets is created in /path/to/project instead of /path/to/project/grailsmodule.

2.4.3 behavior - works fine.

I am using JDK 1.6, Grails 2.4.5, asset pipeline plugin version 1.9.9, and Maven 3.1.1. The behavior is the same for Windows and Linux builds.

Is there a work-around for this issue?

kvsankar commented 9 years ago

It appears that this issue is the same as or is related to https://github.com/grails/grails-maven/issues/54 . I was able to get the build working by enabling fork.

davidklebanoff commented 8 years ago

I, too, am still experiencing this issue. 2.4.3 works, but 2.4.4 and 2.4.6 have the issues you described.