You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Chaimungkalanont <ma...@atlassian.com> on 2006/05/25 10:02:17 UTC

[m2] Getting results of maven-buildnumber-plugin as a filter parameter

Hi all,

I was looking for something to make the date a WAR was built available in the app, so I 
wanted this stored as a properties file in the resources directory. I've found the plugin 
maven-buildnumber-plugin which seems to populate a ${buildNumber} and ${timestamp} values.

This works fine when I use ${buildNumber} within the POM as part of the <finalName /> but 
doesn't do anything when I try to pass it through as property for a filtered parameter. 
Could it be that the plugin hasn't run yet when the properties are resolved? Maybe I need 
a different goal than "create'?

Any thoughts?

<snippets are below>

-----------------------------------------
test.properties - in the resources folder
-----------------------------------------
application.build.number=${timestamps}
application.build.date=${buildNumbers}
test=${buildNumber}
test2=${timestamp}

---------------
pom.xml snippet
---------------

   <build>
     <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>maven-buildnumber-plugin</artifactId>
         <version>0.9.2-SNAPSHOT</version>
         <configuration>
           <skipUpdate>true</skipUpdate>
           <skipCheck>true</skipCheck>
         </configuration>
         <executions>
           <execution>
             <goals>
               <goal>create</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
     </plugins>

     <resources>
       <resource>
         <directory>src/main/resources</directory>
         <filtering>true</filtering>
       </resource>
     </resources>

     <finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>
   </build>

   <properties>
     <timestamps>${timestamp}</timestamps>
     <buildNumbers>${buildNumber}</buildNumbers>
   </properties>

---------------

Thanks!

Mark C
-- 
-------------------------------------
ATLASSIAN - http://www.atlassian.com
Australia's Fastest Growing Software Company 2002-05 [BRW Magazine]

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