|
Can property names include colons? I am referring to last example.
Bug fix here: https://svn.apache.org/repos/asf/maven/sandbox/branches/MNG-3536
This is part of a rewrite of the interpolation code.
I like the idea proposed by Sharmarke Aden in The only thing that might be missing is the locale. Could perhaps be integrated like this: ${mvn.tstamp-lang,country,variant.DATE_FORMAT} which should be straightforward to parse. If this is fixed, can someone comment on the resolution? What was chosen?
A user asked about this on irc:
benson0: I'm lost in the maze of I can't find it anywhere in the site, however grep does turn up a mention in maven-project-spec.tex as well as the code/tests. Per Wendy's last comment captured from benson0 and Jason, I'm after the same thing. I have a .properties file that is part of our filtered resources that I want to put the timestamp into. If I put ${build.timestamp} into the .properties file it isn't replaced. I see this interpolation in the source of the 2.2.0 branch of Maven, which we are using, in the file maven-project/src/main/java/org/apache/maven/project/interpolation/BuildTimestampValueSource.java
Even though I couldn't get it to work "raw", I did find a workaround. If I put <properties> <mytimestamp>${build.timestamp}</mytimestamp> </properties> into the pom.xml and then use ${mytimestamp} in the .properties file, it indeed does expand to 20090701-1656. Matthew, I believe there is probably a misunderstanding. We have to distinguish what gets interpolated (and by whom). The Maven core is only responsible for interpolating the POM, not the resources or any other project source files. The latter is the job for plugins, usually the Maven Resources Plugin. So you should fill the issue at the plugin which needs to be updated to support the timestamp as a new interpolation source. The plugin can fetch the value from the MavenSession.
BTW, I updated the site some time ago so that the feature in now documented, see Available Variable |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I think this issue should focus on merely adding the timestamp property, I think formatting is much better handled by MNG-3374. Reason: I may want to use multiple formats for the same timestamp, for example, UTC and ISO-8601 in the JAR manifest and Europe/Amsterdam with a custom pattern in a common footer JSP.
wrt reactor builds: is it desirable (or even possible) to add the timestamp for every sub-module in addition to the timestamp the build was started? The naming scheme could use Maven coordinates: