amit, 

You can use the same Nick suggestion using two execution tags to same plugin
tag. Try this:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>0.9.6</version>
            <executions>
                <execution>
                    <id>generate-buildnumber</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>create</goal>
                    </goals>
                  <configuration>
                   <format>{0,date,MM-DD-YYYY}</format>
                     <items>
                        <item>timestamp</item>
                     </items>
                    
<buildNumberPropertyName>buildDateToDirectory</buildNumberPropertyName>
                  </configuration>
                </execution>
                <execution>
                    <id>generate-timestamp</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>create</goal>
                    </goals>
                    <configuration>
                        <format>{0,date,MM-DD-YYYY-HH-mm}</format>
                        <items>
                          <item>timestamp</item>
                       </items>
                      
<buildNumberPropertyName>buildDateToJar</buildNumberPropertyName>
                    </configuration>
                </execution>
            </executions>
        </plugin> 

Use ${buildDateToDirectory} and ${buildDateToJar} instead of ${buildNumber}.

Sergio M C Figueiredo
my blog in "pt-BR": http://devdelver.wordpress.com/ 


amit kumar-18 wrote:
> 
> I am inheriting the ${build.directory} property from the root project and
> then in children projects i am trying to give the <finalName> as xxxx -
> ${buildNumber}  but its taking the format same as I defined in the root
> pom.
> Any ideas?
> 
> Amit
> 
> On Tue, Apr 29, 2008 at 2:50 PM, amit kumar <[email protected]>
> wrote:
> 
>> Can I have two separate variables containing build number values in
>> different format?
>> Actually want to use build number for both the build directory name and
>> the time stamp in jar file names.
>> so a buildnumber with format MM-DD-YYYY be the build directory name
>> and MM-DD-YYYY-HH-mm gets appended to the jar names and in the manifest
>> file.
>>
>>
>> Regards,
>> Amit
>>
>>
>> On Tue, Mar 11, 2008 at 7:09 PM, Rex Huang <[email protected]>
>> wrote:
>>
>> > Thank you for your suggestion,
>> > but  it seems not working correcttly for the bug of this plugin.
>> >
>> > the results as below:
>> > [buildnumber:create {execution: generate-buildnumber}]
>> > Storing buildNumber: 16 at timestamp: 1205242293453
>> > [buildnumber:create {execution: generate-timestamp}]
>> > Storing buildNumber: Tue Mar 11 14:31 CET 2008 at timestamp:
>> > 1205242293453
>> >
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/how-to-use-buildnumber-maven-plugin-tp15875096p26889432.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to