Re: [m2] maven-buildnumber-plugin
I wouldn't think anyone is using it 'per' module. I did open a feature request in the Maven Jira for the ability to dynamically change the behavior of all maven plugins from per module to aggregator. This might help these kind of issues in the future. Thanks for writing the plugin :) Franz Julian Wood wrote: > > This is a nice solution. I wonder if there's any way to trigger this > behaviour on demand. Or maybe I should just change the plugin to > always be an aggregator. I wonder if anyone depends on it running > once per module? > > J > > On 28-Feb-07, at 2:12 PM, fgarsombke wrote: > >> >> I got around this by making the build-number-plugin @aggregator style. >> >> I just changed the javadoc tag in the plugin and rebuilt it. >> >> >> /** >> * This mojo is designed to give you a build number. So when you >> might make >> 100 builds of version >> * 1.0-SNAPSHOT, you can differentiate between them all. The build >> number is >> based on the revision >> * number retrieved from scm. It only works with subversion, >> currently. This >> mojo can also check to make >> * sure that you have checked everything into scm, before issuing >> the build >> number. That behaviour can be suppressed, >> * and then the latest local build number is used. Build numbers >> are not >> reflected >> * in your artifact's filename (automatically), but can be added to >> the >> metadata. You can access the build >> * number in your pom with ${buildNumber}. >> * >> * @author mailto:[EMAIL PROTECTED] Julian Wood >> * @version $Id: BuildNumberMojo.java,v 1.0 Feb 7, 2006 11:43:08 AM >> woodj >> Exp $ >> * @goal create >> * @requiresProject >> * @aggregator >> * @description create a build number from scm if possible, >> otherwise a >> timestamp >> */ >> >> It then only increments the build number once per the entire build. >> >> >> Franz Garsombke >> -- > > -- > Julian Wood <[EMAIL PROTECTED]> > > Software Engineer > Teaching & Learning Centre > University of Calgary > > http://tlc.ucalgary.ca > > > > -- View this message in context: http://www.nabble.com/maven-buildnumber-plugin-tf3281875s177.html#a9241889 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] maven-buildnumber-plugin
I'm not sure if the aggregator works if you're using a timestamp as the build number, it certainly didn't for me. This is what I have in my BuildNumberMojo.java or perhaps I'm passing the wrong options:-) * @author mailto:[EMAIL PROTECTED]">Julian Wood * @version $Id: BuildNumberMojo.java,v 1.1 2007/02/26 20:52:42 egaona Exp $ * @goal create * @requiresProject * @description create a build number from scm if possible, otherwise a timestamp * @aggregator true * @requiresOnline true * @inheritedByDefault false Enrique fgarsombke <[EMAIL PROTECTED]> wrote on 02/28/2007 03:12:19 PM: > > I got around this by making the build-number-plugin @aggregator style. > > I just changed the javadoc tag in the plugin and rebuilt it. > > > /** > * This mojo is designed to give you a build number. So when you might make > 100 builds of version > * 1.0-SNAPSHOT, you can differentiate between them all. The build number is > based on the revision > * number retrieved from scm. It only works with subversion, currently. This > mojo can also check to make > * sure that you have checked everything into scm, before issuing the build > number. That behaviour can be suppressed, > * and then the latest local build number is used. Build numbers are not > reflected > * in your artifact's filename (automatically), but can be added to the > metadata. You can access the build > * number in your pom with ${buildNumber}. > * > * @author mailto:[EMAIL PROTECTED] Julian Wood > * @version $Id: BuildNumberMojo.java,v 1.0 Feb 7, 2006 11:43:08 AM woodj > Exp $ > * @goal create > * @requiresProject > * @aggregator > * @description create a build number from scm if possible, otherwise a > timestamp > */ > > It then only increments the build number once per the entire build. > > > Franz Garsombke > -- > View this message in context: http://www.nabble.com/maven- > buildnumber-plugin-tf3281875s177.html#a9235485 > Sent from the Maven - Users mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
Re: [m2] maven-buildnumber-plugin
This is a nice solution. I wonder if there's any way to trigger this behaviour on demand. Or maybe I should just change the plugin to always be an aggregator. I wonder if anyone depends on it running once per module? J On 28-Feb-07, at 2:12 PM, fgarsombke wrote: I got around this by making the build-number-plugin @aggregator style. I just changed the javadoc tag in the plugin and rebuilt it. /** * This mojo is designed to give you a build number. So when you might make 100 builds of version * 1.0-SNAPSHOT, you can differentiate between them all. The build number is based on the revision * number retrieved from scm. It only works with subversion, currently. This mojo can also check to make * sure that you have checked everything into scm, before issuing the build number. That behaviour can be suppressed, * and then the latest local build number is used. Build numbers are not reflected * in your artifact's filename (automatically), but can be added to the metadata. You can access the build * number in your pom with ${buildNumber}. * * @author mailto:[EMAIL PROTECTED] Julian Wood * @version $Id: BuildNumberMojo.java,v 1.0 Feb 7, 2006 11:43:08 AM woodj Exp $ * @goal create * @requiresProject * @aggregator * @description create a build number from scm if possible, otherwise a timestamp */ It then only increments the build number once per the entire build. Franz Garsombke -- -- Julian Wood <[EMAIL PROTECTED]> Software Engineer Teaching & Learning Centre University of Calgary http://tlc.ucalgary.ca
Re: [m2] maven-buildnumber-plugin
I got around this by making the build-number-plugin @aggregator style. I just changed the javadoc tag in the plugin and rebuilt it. /** * This mojo is designed to give you a build number. So when you might make 100 builds of version * 1.0-SNAPSHOT, you can differentiate between them all. The build number is based on the revision * number retrieved from scm. It only works with subversion, currently. This mojo can also check to make * sure that you have checked everything into scm, before issuing the build number. That behaviour can be suppressed, * and then the latest local build number is used. Build numbers are not reflected * in your artifact's filename (automatically), but can be added to the metadata. You can access the build * number in your pom with ${buildNumber}. * * @author mailto:[EMAIL PROTECTED] Julian Wood * @version $Id: BuildNumberMojo.java,v 1.0 Feb 7, 2006 11:43:08 AM woodj Exp $ * @goal create * @requiresProject * @aggregator * @description create a build number from scm if possible, otherwise a timestamp */ It then only increments the build number once per the entire build. Franz Garsombke -- View this message in context: http://www.nabble.com/maven-buildnumber-plugin-tf3281875s177.html#a9235485 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [M2]maven-buildnumber-plugin
Julian Wood <[EMAIL PROTECTED]> wrote on 02/28/2007 12:27:37 PM: > I don't know how you can do this. I've come across this before, and > haven't been able to come up with a solution. In the end, you have to > work with it. Either change the format so that it is something which > will be the same even if they are executed a few seconds apart, or > use revision numbers from scm, which will be the same. Yeah, this would have been my choice, but the developers want a date timestamp:-) > > If anyone knows how to prevent the modules from running the parent > plugin, please let us know. Actually, I wonder if you could specify > the plugin in the module poms again, but fiddle with the execution. > Does it override what the parent specifies? Does it execute in > addition to the parent? If it overrides, then you could change the > phase or get rid of the goal. You might be able to stop it that way. > Worth a shot. In the end, my workaround was to modify the maven-buildnumber-plugin. Here's the code snippet if ( project != null ) { //Check if buildNumber has been set //If not, set it to t buildNumber String buildnum = System.getProperty("buildNumber"); if (buildnum == null) { System.setProperty("buildNumber", revision); } revision = System.getProperty("buildNumber"); project.getProperties().put( "buildNumber", revision ); String buildnumber = (String) project.getProperties().get("buildNumber"); getLog().info( "Build Number: " + buildnumber ); } Enrique > > J > > On 24-Feb-07, at 12:19 PM, Enrique Gaona wrote: > > > Hi, > > Anyone know how I can do this? Thanks > > > > Enrique > > > >> 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. > > > > > >org.codehaus.mojo > > > > maven-buildnumber-plugin > >0.9.4 > > > > > >validate > > > > > > create > > > > > > > > > >false > >false > >{0,date,-MM-dd > > HH:mm:ss} > > > >timestamp > > > > > > > > > > > > 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 > > false in the parent pom, it executes the plugin > > once, but the child poms do not get the buildNumber. > > > > -- > Julian Wood <[EMAIL PROTECTED]> > > Software Engineer > Teaching & Learning Centre > University of Calgary > > http://tlc.ucalgary.ca > >
Re: [M2]maven-buildnumber-plugin
I don't know how you can do this. I've come across this before, and haven't been able to come up with a solution. In the end, you have to work with it. Either change the format so that it is something which will be the same even if they are executed a few seconds apart, or use revision numbers from scm, which will be the same. If anyone knows how to prevent the modules from running the parent plugin, please let us know. Actually, I wonder if you could specify the plugin in the module poms again, but fiddle with the execution. Does it override what the parent specifies? Does it execute in addition to the parent? If it overrides, then you could change the phase or get rid of the goal. You might be able to stop it that way. Worth a shot. J On 24-Feb-07, at 12:19 PM, Enrique Gaona wrote: Hi, Anyone know how I can do this? Thanks Enrique 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. org.codehaus.mojo maven-buildnumber-plugin 0.9.4 validate create false false {0,date,-MM-dd HH:mm:ss} timestamp 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 false in the parent pom, it executes the plugin once, but the child poms do not get the buildNumber. -- Julian Wood <[EMAIL PROTECTED]> Software Engineer Teaching & Learning Centre University of Calgary http://tlc.ucalgary.ca
RE: [m2] Maven-buildnumber plugin
Sorry, it's OK. -Mensaje original- De: Marcelo Colomer Cornejo [mailto:[EMAIL PROTECTED] Enviado el: mié 28/02/2007 19:18 Para: Maven Users List Asunto: RE: [m2] Maven-buildnumber plugin Page not found -Mensaje original- De: Julian Wood [mailto:[EMAIL PROTECTED] Enviado el: mié 28/02/2007 19:14 Para: Maven Users List Asunto: Re: [m2] Maven-buildnumber plugin It's back up. J On 27-Feb-07, at 12:36 PM, shinsato wrote: > > The maven-buildnumber-plugin seems to have disappeared from the > ucalgary > site. > > http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/ > index.html > > Any hints of where it might have gone? I don't see it on codehaus. -- Julian Wood <[EMAIL PROTECTED]> Software Engineer Teaching & Learning Centre University of Calgary http://tlc.ucalgary.ca
RE: [m2] Maven-buildnumber plugin
Page not found -Mensaje original- De: Julian Wood [mailto:[EMAIL PROTECTED] Enviado el: mié 28/02/2007 19:14 Para: Maven Users List Asunto: Re: [m2] Maven-buildnumber plugin It's back up. J On 27-Feb-07, at 12:36 PM, shinsato wrote: > > The maven-buildnumber-plugin seems to have disappeared from the > ucalgary > site. > > http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/ > index.html > > Any hints of where it might have gone? I don't see it on codehaus. -- Julian Wood <[EMAIL PROTECTED]> Software Engineer Teaching & Learning Centre University of Calgary http://tlc.ucalgary.ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [m2] Maven-buildnumber plugin
It's back up. J On 27-Feb-07, at 12:36 PM, shinsato wrote: The maven-buildnumber-plugin seems to have disappeared from the ucalgary site. http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/ index.html Any hints of where it might have gone? I don't see it on codehaus. -- Julian Wood <[EMAIL PROTECTED]> Software Engineer Teaching & Learning Centre University of Calgary http://tlc.ucalgary.ca
Re: [m2] Maven-buildnumber plugin
The maven-buildnumber-plugin seems to have disappeared from the ucalgary site. http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/index.html Any hints of where it might have gone? I don't see it on codehaus. -- View this message in context: http://www.nabble.com/Maven-buildnumber-plugin-tf2322368s177.html#a9190056 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [M2]maven-buildnumber-plugin
Hi, Anyone know how I can do this? Thanks Enrique Enrique Gaona/Austin/IBM@ IBMUS To "Maven Users List" 02/23/2007 05:25 PM cc Subject Please respond to [M2]maven-buildnumber-plugin "Maven Users List" <[EMAIL PROTECTED] he.org> 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. org.codehaus.mojo maven-buildnumber-plugin 0.9.4 validate create false false {0,date,-MM-dd HH:mm:ss} timestamp 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 false 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