On 06/12/2012, at 8:22 AM, Daz DeBoer wrote: > On 5 December 2012 13:21, Adam Murdoch <[email protected]> wrote: > > On 06/12/2012, at 3:24 AM, Daz DeBoer wrote: > >> G'day >> I'm adding 'mvn install' type support to the new 'maven-publish' plugin. >> Just wanted to confirm some behaviour: >> Should we _always_ try to install to maven local repo when publishing to a >> remote maven repository. So 'publish' with the 'maven-publish' plugin will >> combine the current 'deploy' and 'install' of the 'maven' plugin. I think >> this makes sense, as it matches the behaviour of 'mvn deploy'. An >> alternative would be a separate lifecycle task for 'maven-install'. > > I'd rather not install. It strikes me as it would cause problems with > reproducibility, as any subsequent Maven builds that you run on the machine > will use the stuff from the machine, rather than authoritative repository. So > if you're doing the publish from a CI machine, you're affecting the results > of any subsequent CI builds that consumers may run on the same machine. > > So, running 'gradle publish' should publish to exactly those repositories > listed in the publishing.repositories container. If you want to do an install > on publish, you can add mavenLocal() there. > > So step 8. of > https://github.com/gradle/gradle/blob/master/design-docs/publication-model.md#customising-maven-descriptor-xml > is just to define the 'publishLocal*' tasks, not wire them into any > lifecycle?
That's what it says, but it might be worth having a lifecycle task for local publishing, for the case where the project publishes multiple Maven modules, and the case where you use non-standard publication names, and if we add the equivalent concept for Ivy/Gradle publications (not that we're planning to). We could either add something like 'publishLocal', which would publish all publications to their local destinations, for those publication types that have a conventional local destination (which would only be Maven publications for now). Or, we add something like 'installToMavenLocal' which would publish each Maven publication to mavenLocal(). -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
