Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C586410BC7 for ; Thu, 1 Aug 2013 12:26:07 +0000 (UTC) Received: (qmail 17814 invoked by uid 500); 1 Aug 2013 12:26:05 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 17672 invoked by uid 500); 1 Aug 2013 12:26:03 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 17664 invoked by uid 99); 1 Aug 2013 12:26:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 12:26:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jodastephen@gmail.com designates 209.85.212.49 as permitted sender) Received: from [209.85.212.49] (HELO mail-vb0-f49.google.com) (209.85.212.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 12:25:58 +0000 Received: by mail-vb0-f49.google.com with SMTP id w16so1981830vbb.36 for ; Thu, 01 Aug 2013 05:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=5a83nUG/2P0JH4BLLD8OlCxlbOqG7MF5kL/ISbED7Hs=; b=sjyn6PvslUNJGV0qlru1FQjevI+bklX2iGZ73gN3JC+9AnzZcPAO9pwJIHhnwUS8cY O26oKphv4PzqK2m7kMQ9CJjJJWO9vBkhMB9WnBQa/Cw1x4qT3I8Y/1HuDspfI8vJBYP9 JE/wmdTVFzC4MzmtUl4jekrJS97dKH8dEekQ5RChtl/0DzJeLwUcwLqSr2YWuZeLhUQm Gr35+sMT6ipA01glxqzW2+9v9pQVqNBO2O29xLYzQf9DHrXDklIsVK9W+WFTffhCNjwP KT/qsqDkv9MftJs/BzQ3viyOafEoU4jgDcM2EIBjiphP95yT2YPsT8ZEBPeVGx5kx6o0 mTgA== X-Received: by 10.221.49.134 with SMTP id va6mr399260vcb.14.1375359937354; Thu, 01 Aug 2013 05:25:37 -0700 (PDT) MIME-Version: 1.0 Sender: jodastephen@gmail.com Received: by 10.58.144.3 with HTTP; Thu, 1 Aug 2013 05:25:17 -0700 (PDT) In-Reply-To: References: <51F7DAEE.4000707@artifact-software.com> <1375217160473-5766321.post@n5.nabble.com> <51F875F9.5060109@artifact-software.com> <1375334367452-5766461.post@n5.nabble.com> From: Stephen Colebourne Date: Thu, 1 Aug 2013 13:25:17 +0100 X-Google-Sender-Auth: 1-5UsELmlThc8qXckC4V0dUHOTk Message-ID: Subject: Re: continuous releasing: versions:set and/or release:update-version to release an aggregator project To: Maven Users List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I think this is perhaps related to problems I am seeing right now as well. Basically, the versions:set goal is buggy except in the classic case where the hierarchy of aggregation matches the hierarchy of inheritance. See http://jira.codehaus.org/browse/MVERSIONS-131 and http://jira.codehaus.org/browse/MVERSIONS-184 For example, given a tree: A (pom only) - B - C (pom only) - - D - - E where B and C are children of A and D and E are children of C and A aggregates B and C and C aggregates D and E In this case, versions:set plugin will work fine Now consider adding a new root R which aggregates A, but is not the parent of A. If you run versions:set on R it will only update R, and not A/B/C/D/E If you manually set the version of A, and then run versions:set on R, projects R/A/B/D/E will be updated, but not C. (which is pretty weird) The patch in MVERSIONS-131 sounds reasonable. Could it be evaluated? Stephen On 1 August 2013 09:55, Stephen Connolly wrote: > How I want this to work is to have versions-maven-plugin have a way to undo > versions:resolve-ranges ( > http://mojo.codehaus.org/versions-maven-plugin/resolve-ranges-mojo.html) - > it would need to ensure that the lower bound of any unresolved range is the > resolved version... [see below] > > We'd need to split preparationGoals in the release plugin... either into > preparationGoals + verificationGoals or into initiationGoals + > preparationGoals (I favour the latter as it preserves the semantics of > preparationGoals... but the first one maps more correctly with what each > set should be doing) > > Then this would become super easy... > > You develop with version ranges for your dependencies... > > The release plugin would have > initiationGoals = versions:resolve-ranges versions:commit > preparationGoals = clean verify > completionGoals = versions:unresolve-ranges versions:commit > > So say your development pom has > > > ... > foo > [1.0,2.0) > > > and the latest version of foo is 1.2 > > When you kick off the release, the range gets resolved to > > > ... > foo > 1.2 > > > (My current thought is to use an XML PI to stash the old range) > > Then we invoke Maven again (because Maven doesn't re-read the poms) and do > a "clean verify" to make sure that this all builds > > Then we tag the release > > Then we run completionGoals and versions:unresolve-ranges puts the version > range back, but upping the lower bound > > > ... > foo > [1.2,2.0) > > > Maven ups the pom version to next development snapshot and commits the pom > > That will give you the ability to develop on ranges (which is nice and > flexible) but release on pinned versions (which is exactly what you should > be doing) > > If we cannot deliver something like that, then I think we should just drop > ranges from the next major version of Maven. > > > > > On 1 August 2013 06:19, Nestor Urquiza wrote: > >> Hi, >> >> Let me give more information, >> >> I use an aggregator project for war1 project: >> >> ../jar1 >> ../jar2 >> ../war-inc >> ../war1 >> >> >> Another aggregator project for war2 project: >> >> ../jar1 >> ../war-inc >> ../war1 >> >> >> Notice they both depend on jar1. The jar2 project in fact depends also on >> jar1. The war-inc project is used to keep common web resources for war1 and >> war2. We use maven overlay to marge those shared resources in a final war >> for each project. >> >> This is working like a charm. It has been working in fact now for 3 years. >> However everytime we need a release we need to start updating version >> unmbers in dependencies, doing prepare, then perform, you know the story. >> This is great when the team releases every once in a while. This is an >> issue >> if you want to release several times a day. About resources needed and so >> on >> that is something we are tackling via idempotent scripts so we are >> literally >> ready to make sure we increase the version number for all projects at once >> every time new code is committed to the version control server. We can >> handle that last part with jenkins, that is not a problem either. The only >> problem is how can I leverage on an existing tool (without building it >> myself) that would allow to release all modules from just one command. >> >> So back to Roger suggestion I added the version override dependency as per >> the github project, updated the version tag to point to 0.2.0 and run the >> below command (including actually the very same example from github): >> mvn clean install -Dversion.override=1.2.3-RC-5 >> >> However none of the modules were changed including no change to the >> aggregator project either. >> >> Roger, have you used this plugin with aggregator projects as I am trying? >> Could you provide some further guidance? >> >> My option is looking more and more like I will need to do something like: >> foreach module >> replace module version >> for each dependency >> if it is a module >> replace module version >> >> Then find out if mvn:prepare and mvn:perform will work after from the >> aggregator project releasing all necessary projects correctly. At this >> point >> I am already facing another issue. Let us suppose I update my two war >> multi-pom aggregator projects, all the modules and the dependencies to be >> version 2.2000.0-SNAPSHOT. >> >> I would expect a command line the below to change the version number in all >> modules to 2.2000.0, tag it preparing it for release as well as setting the >> next development version to be 2.2000.1-SNAPSHOT for all modules as well. >> Finally each dependency that is a module itself should also be changed to >> 2.2000.1-SNAPSHOT. But that does not work either: >> mvn clean --batch-mode release:prepare -DdryRun=true >> -DautoVersionSubmodules=true -DreleaseVersion=2.2000.0 >> -DdevelopmentVersion=2.2000.1-SNAPSHOT >> >> The resulting pom.xml.tag gets updated even dependencies but the >> pom.xml.next gets updated (2.2000.1-SNAPSHOT) only for the version number >> of >> each project, nor for the dependencies which do stay the same >> (2.2000.0-SNAPSHOT). Will this be considered a bug? >> >> I hope it is clear now what I need and also what the current issues are: >> Not >> only versions:set and release:update-version do not work for >> multipom-aggregator projects but in addition release:prepare together with >> all the flags above which according to the documentation should be allowing >> to fix a version for a release. >> >> I guess an alternative question could be "how to provide continuous >> delivery >> with multi-pom aggregator maven projects". To be honest I do not like the >> idea of forcing all versions, it just looked the logical approach after we >> decided we really did not care for internal versions, they could be handled >> ideally automatically. However thinking twice about this I would like >> better >> maven to accept a pattern to set part of the snapshot version number while >> changing another part of it, for example with a mask: >> >> -DversionNumberIncrementalMask=x.1.0 >> >> which would translate to: >> Leave first digit as is >> Increase by 1 second digit >> set to zero third digit >> >> Of course I would expect this to be applied to all snapshots. >> >> Thanks for the answers so far, >> >> - Nestor >> >> >> >> >> -- >> View this message in context: >> http://maven.40175.n5.nabble.com/continuous-releasing-versions-set-and-or-release-update-version-to-release-an-aggregator-project-tp5766275p5766461.html >> Sent from the Maven - Users mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org >> For additional commands, e-mail: users-help@maven.apache.org >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org