> -----Original Message----- > From: Karl Heinz Marbaise [mailto:khmarba...@gmx.de] > Sent: Tuesday, October 24, 2017 12:25 PM > To: Justin Georgeson <justin.george...@halliburton.com>; > i...@soebes.de; Maven Users List <users@maven.apache.org> > Subject: Re: [EXTERNAL] Re: how to use both buildnumber-maven-plugin > and maven-release-plugin > > External Sender: Use caution with links/attachments. > > > > Hi, > > On 24/10/17 15:59, Justin Georgeson wrote: > > I want to enforce in every build (not just release builds) > > that the working copy is pristine > > > (ie doCheck=true for buildnumber plugin), > > On a CI server or locally ?
It is enabled globally in the parent POM, as during transition from older Ant builds to Maven it has helped remind developers to do things like use resource filtering from source folder to build output folder rather than modifying in place (whether that be for source code or unit test resources) and also reduced pushing incomplete changes forgetting to include some of the modified files. I'm guessing this default setting will be the key distinction why people are confused how I'm having an issue with the combination. > > but release:prepare dirties the working copy before running 'clean verify'. > > Of course it does cause it changes the pom files to represent the correct > version...and commit this state of the change back to version control... My impression had been that the release plugin was invoking goals from the tag that it creates, rather than from a dirty working copy, for guaranteed reproducible results. I can see why that would be undesirable for centralized VCS like subversion though. > > So when I run release:prepare the buildnumber plugin fails. I can work > > around it by running 'mvn release:prepare > > -Darguments="-Dmaven.buildNumber.doCheck=false"' but that just > seems hacky, so I was curious if there's a better way. > > > You know about the release:prepare goal what it is exactly doing ? > > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__maven.apache.org_maven-2Drelease_maven-2Drelease- > 2Dplugin_examples_prepare- > 2Drelease.html&d=DwICaQ&c=PskvixtEUDK7wuWU- > tIg6oKuGYBRbrMXk2FZvF0UfTo&r=IaG729QyGh1osYCbh8OX9axItHyepxef_h > VPx52Ly1s&m=WiG6vQ6aiVWMFCcORnOeArhgldg_TZF7xNV8d1YlECI&s=4f- > Z8rl_qNhiUE4vBGA0mqAkY7Gb2rBntNqcUT9JwsE&e= Clearly I didn't know _exactly_ what it was doing :) Most of our internal Maven usage has been for the Eclipse Tycho plugins thus far, and that's just not really compatible with maven-release-plugin so there's some technical debt I'm trying to get rid of to make our parent POMs more friendly to pure maven projects. > Maybe I misunderstand your question but it sounds like you are trying to > resolve a thing which has been solved by maven-release-plugin already?... I just wanted opinions on the cleanest way to configure the two to work together. I still need buildnumber-maven-plugin to run during the release build. I now know I have to disable its check when preparing a release. If I set project.properties.maven.buildNumber.doCheck to true (instead of setting it to doCheck true in the plugin <configuration>), then have a profile that activates on present of maven-release-plugin temporary files and sets the property to false (like in example POM [1], corp proxy blocks pastebin), then the release:prepare and release:perform goals seem work without having to specify any extra -D command-line arguments and with the added benefit that developers should then be able to also set maven.buildNumber.doCheck to false in their settings.xml if they want to. Is there a better activation rule (than what's in the example POM [1)? [1] https://paste.ee/p/tKYyh > Kind regards > Karl Heinz Marbaise > > > > > Looks like if I configure a default property value for > maven.buildNumber.doCheck to true, then I can have a profile activate > when file https://urldefense.proofpoint.com/v2/url?u=http- > 3A__release.properties&d=DwICaQ&c=PskvixtEUDK7wuWU- > tIg6oKuGYBRbrMXk2FZvF0UfTo&r=IaG729QyGh1osYCbh8OX9axItHyepxef_h > VPx52Ly1s&m=WiG6vQ6aiVWMFCcORnOeArhgldg_TZF7xNV8d1YlECI&s=DzY > 1956dm73empQx_us9QzZ5BL5yahhbKcjGLKyMT80&e= exists to set the > doCheck property to false, and that gets me through release:prepare. Any > pitfalls I might be walking into with something like that? > > > > -----Original Message----- > > From: Karl Heinz Marbaise [mailto:khmarba...@gmx.de] > > Sent: Tuesday, October 24, 2017 4:30 AM > > To: Maven Users List <users@maven.apache.org>; Justin Georgeson > > <justin.george...@halliburton.com> > > Subject: [EXTERNAL] Re: how to use both buildnumber-maven-plugin and > > maven-release-plugin > > > > External Sender: Use caution with links/attachments. > > > > > > > > Hi, > > > > the question is what the real problem is? > > > > Can you have an example project which shows the problem? Or can you > describe more in detail what exactly does not work or not work like you > expect it.. > > > > Kind regards > > Karl Heinz Marbaise > > ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.