You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marshall Schor <ms...@schor.com> on 2010/08/03 23:27:41 UTC

property substitution problem in

 In my build I set the build final name for some things using

<finalName>a.b.c_${parsedVersion.osgiVersion}</finalName>

where ${parsedVersion.osgiVersion} is a parameter value set by executing the
maven-build-helper plugin which is the first plugin run when the build executes
(I checked this and observed it, using the -X debug flag).

If I use the maven-jar-plugin to build the jar, it gets the value of
"finalName", which, I suspect, is
"a.b.c_${parsedVersion.osgiVersion}" and then changes it by substituting the
value of that property, so it comes out something like

"a.b.c_2.3.1".

This works fine (it's just what I want) when I use the maven-jar-plugin.

However, I'm now using for some projects the maven-bundle-plugin (groupId
org.apache.felix).  This plugin, when it is given the same string, appears to
not rescan it for variables, and does not therefore substitute values.  So, its
"bundle" goal works, but generates the artifact using the name
"a.b.c_${parsedVersion.osgiVersion}", which is, obviously, not what I need.

To work around this, I can run an "ant-run" build step to rename this file.  I'm
guessing however, that there could likely be other metadata around that's being
associated to this name, and therefore, this might not be effective. 

Maybe I need to do both an "ant-run" rename, plus a
maven-build-helper:attach-artifact to re-mark the renamed jar as the primary
artifact?

Does anyone have a less kludgy workaround for this kind of issue?

-Marshall Schor

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org