How do you run a plugin the parent pom only once and have its configuration
inherited by its children.   I'm using the maven-buildnumber-plugin in my
parent pom and when I run my build, this plugin gets executed on every
child pom and I end up with different buildNumber ID.

            <plugin>
                                <groupId>org.codehaus.mojo</groupId>

<artifactId>maven-buildnumber-plugin</artifactId>
                                <version>0.9.4</version>
                                <executions>
                                        <execution>
                                                <phase>validate</phase>
                                                <goals>
                                                        <goal>create</goal>
                                                </goals>
                                        </execution>
                                </executions>
                                <configuration>
                                        <doCheck>false</doCheck>
                                        <doUpdate>false</doUpdate>
                                        <format>{0,date,yyyy-MM-dd
HH:mm:ss}</format>
                                        <items>
                                                <item>timestamp</item>
                                        </items>
                                </configuration>
                        </plugin>


As you can see from the output, the both the parent and child pom.xml
executes the plugin ad the  buildNumber gets changed.   So, basically, I
just want the plugin to run once and have the child poms inherit the
buildNumber.   Is this doable?  I tried using the
<inherited>false</inherited> in the parent pom, it executes the plugin
once, but the child poms do not get the buildNumber.


[INFO]
----------------------------------------------------------------------------
[INFO] Building Master POM File csdp.platform version 1.1 (csdp_dev latest)
[INFO]    task-segment: [clean, antrun:run, install, rpm:rpm]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/target
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/target/classes
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/target/test-classes
[INFO] [antrun:run]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [buildnumber:create {execution: default}]
[INFO] Storing buildNumber: 2007-02-23 17:07:06   <----****************


[INFO]
----------------------------------------------------------------------------
[INFO] Building CSDP Prereq Main
[INFO]    task-segment: [clean, antrun:run, install, rpm:rpm]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/com.ibm.csdp.prereq/target
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/com.ibm.csdp.prereq/target/classes
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/com.ibm.csdp.prereq/target/test-classes
[INFO] [antrun:run]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO] [buildnumber:create {execution: default}]
[INFO] Storing buildNumber: 2007-02-23 17:07:09
<----******************


Enrique

Reply via email to