Hi,
I have a custom script created via grails create-script
At the top of my file I include the following:
includeTargets << new File ( "${grailsHome}/scripts/Init.groovy" )
includeTargets << new File ( "${grailsHome}/scripts/War.groovy" )
Within my script I call war(). The war file that is generated still contains the development path to the log4jproperties in the web.xml which dies when the app is deployed to a container. If I do a "grails war" everything works fine.
I believe this is related to the file below which checks for "war" or "run-war" as the script name in order to alter the log4j param. When I run "my-script" since it does not contain "war" or "run-war" but merely calls the "war()" target, this code does not execute.
http://svn.grails.codehaus.org/browse/grails/trunk/grails/src/groovy/org/codehaus/groovy/grails/plugins/LoggingGrailsPlugin.groovy?r1=6628&r2=6664
The temporary fix hack is to rename my script to contain the word "war" in it.
Follow up, I mis-read the code. Renaming the calling custom script to simply include the word "war" does not fix this. The code that controls the replacement looks explicitly for "war" or "run-war".
The hack fix is to set System.setProperty('current.gant.script',"war") at the top of my custom script