Yes, this is considered bad form. It might be possible to change some POJO properties, but that won't really do it, as you're finding. You can do something along these lines with multiple executions of Maven. I think there are some examples of this with the versions plugin. Something like:
mvn versions:update-parent && mvn clean package Justin On Wed, Dec 15, 2010 at 7:03 PM, Mike Lenner <[email protected]> wrote: > I'd like to write a plugin that allows me to change the version of the > current project during the build. Is this considered bad form? Is it > even possible? > > My use case is that I'd like to replicate what release:prepare is > doing but w/o tagging and w/o checking out new source and running the > build on that source. I'd like to run mvn deploy -P release and in > doing so have my -SNAPSHOT version replaced with the release version > and then have my build progress as normal. > > I've tried using MavenProject.setVersion() but that seemed to have no > effect. I next tried MavenProject.getArtifact().setVersion(). This > seemed to work better however the assembly plugin used later in my > build started to fail with a NPE. Haven't tracked down exactly what > the connection is yet but thought I'd send an email out to see if > anyone else has done this and/or if this is a bad idea. > > Thanks, > Mike > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
