java - Using Groovy in POM file for delimiter switching works differently for different developers -
we using small segment of groovy code within our pom file replace backslash delimiters in main base directory forward slash delimiters. more information on this, see post: how convert file separator in maven
however, problem have suggested groovy link works fine on 1 developers machine, not on another.
what works first developer this: (the code mentioned in linked post)
pom.properties['main.basedir']=project.basedir.absolutepath.replace('\\','/');
what works other developer following:
pom.properties['main.basedir']=project.basedir.absolutepath.replace('\','/');
(note single backslash)
the errors second developer sees when using double backslash are:
[info] build failure [info] ------------------------------------------------------------------------ [info] total time: 1:15.096s [info] finished at: tue sep 03 16:54:18 bst 2013 [info] final memory: 36m/298m [info] ------------------------------------------------------------------------ [error] failed execute goal org.codehaus.gmaven:gmaven-plugin:1.5:execute (setproperty) on project bonus-wallet-amq-tests: startup failed, script1378223658221.groovy: 1: expecting ''', found '<eof>' @ line 1, column 79. [error] 1 error
we can't work out why second developer needs single backslash. both developers using eclipse juno, java 1.6 update 45 , version of groovy must same defined dependency in pom file. (version 1.6.9)
the thing found versions of maven being different. developer 1 has version 3.0.3 , developer 2 has version 3.0.5. have been unable find documentation may relate this.
any beneficial.
you should change code follows:
pom.properties['main.basedir']= project.basedir.absolutepath.replace(file.separator,'/');
instead of manually decode file separator.
Comments
Post a Comment