I have a pom.xml with defined property module.basedir that is intended to contain transformed basedir property. It is defined as follows:
<properties>
<module.basedir>${basedir}</module.basedir>
</properties>
And I have following code that is executed using mgroovy plugin:
<source>
println project.properties['module.basedir']
project.properties['module.basedir']=project.properties['module.basedir'].replace('\\','/');
println project.properties['module.basedir']
</source>
Later I use this property in other plugins. This works fine until I move plugin definitions into maven profile. And when maven profile is activated mgroovy plugin works fine, but when I access property in the next plugin I get unmodified value.
This is how I access this property:
${module.basedir}
It looks like that when profile is executed it creates own copies of properties defined in project and they are used when referenced from plugins.
Any suggestions?
I faced with the same problem using gmaven-plugin on windows to create EJB module description. I'm not a savvy in Groovy, but this approach works for me:
def basedir = project.properties['module.basedir'].replace('\\','/')
def md = (basedir + "/target/module.xml" as File)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With