Mailing List Archive

Maven publication with the Gradle build
Hello,

The release wizard still suggests using Ant for Maven publication:

cd ~/.lucene-releases/9.0.0/lucene
ant clean stage-maven-artifacts \
-Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
\
-Dm2.repository.id=apache.releases.https \
-Dm2.repository.url=https://repository.apache.org/service/local/staging/deploy/maven2

The Gradle build has a `mavenToApacheReleases` task that seems to do
what I want, but I can't find how to tell it to use the JARs of RC4
rather than those produced by `gradlew assembleRelease`. Can someone
help me with this?

--
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Maven publication with the Gradle build [ In reply to ]
There may be some loose ends here. See https://issues.apache.org/jira/browse/LUCENE-9809?focusedCommentId=17433373&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17433373 as a starting point for gradle command.
Related: LUCENE-10174, Umbrella: LUCENE-9488

So the wizard should probably run the gradle equivalent

./gradlew mavenToApacheReleases -Dversion.release=<ver> -PasfNexusUsername=<user> -PasfNexusPassword=<passwd>

Jan

> 6. des. 2021 kl. 14:19 skrev Adrien Grand <jpountz@gmail.com>:
>
> Hello,
>
> The release wizard still suggests using Ant for Maven publication:
>
> cd ~/.lucene-releases/9.0.0/lucene
> ant clean stage-maven-artifacts \
> -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
> \
> -Dm2.repository.id=apache.releases.https \
> -Dm2.repository.url=https://repository.apache.org/service/local/staging/deploy/maven2
>
> The Gradle build has a `mavenToApacheReleases` task that seems to do
> what I want, but I can't find how to tell it to use the JARs of RC4
> rather than those produced by `gradlew assembleRelease`. Can someone
> help me with this?
>
> --
> Adrien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
Re: Maven publication with the Gradle build [ In reply to ]
Hi Adrien,

So. From gradle's point of view I don't think it's possible to reuse
exactly the same files as were present in the RC candidate.
Technically artifacts are a result of the build (tasks) - they can't
be taken arbitrarily from disk. Or rather: it may be possible but will
require terrible hacks.

I suggested to Jan that we could instead package the artifacts as
Sonatype Nexus's "distribution bundle" - a ZIP file with all the
information (poms, checksums, jars) that should be staged. This
requires a manual upload of this ZIP file but otherwise allows
publishing exact identical files that were part of the RC.

If we only care about releasing from the same git hash (but with
rebuilt artifacts - so some things in manifests may change!) then
indeed it's doable via the command Jan mentioned.

I don't think there exists a third way of doing this (?).

I can help add a task that will assemble a Sonatype Nexus bundle which
you'll be able to download to Nexus. It should ultimately be part of
the release candidate artifacts - this would make it explicit what
will get uploaded.

Dawid

On Mon, Dec 6, 2021 at 2:19 PM Adrien Grand <jpountz@gmail.com> wrote:
>
> Hello,
>
> The release wizard still suggests using Ant for Maven publication:
>
> cd ~/.lucene-releases/9.0.0/lucene
> ant clean stage-maven-artifacts \
> -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
> \
> -Dm2.repository.id=apache.releases.https \
> -Dm2.repository.url=https://repository.apache.org/service/local/staging/deploy/maven2
>
> The Gradle build has a `mavenToApacheReleases` task that seems to do
> what I want, but I can't find how to tell it to use the JARs of RC4
> rather than those produced by `gradlew assembleRelease`. Can someone
> help me with this?
>
> --
> Adrien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Maven publication with the Gradle build [ In reply to ]
I believe maven/nexus natively allows publishing an RC to the staging repo
and then manually promoting to a release. Apache infra has this dual set up
for us already.

Would gradle be able to hook into that process?

On Mon, Dec 6, 2021 at 9:15 AM Dawid Weiss <dawid.weiss@gmail.com> wrote:

> Hi Adrien,
>
> So. From gradle's point of view I don't think it's possible to reuse
> exactly the same files as were present in the RC candidate.
> Technically artifacts are a result of the build (tasks) - they can't
> be taken arbitrarily from disk. Or rather: it may be possible but will
> require terrible hacks.
>
> I suggested to Jan that we could instead package the artifacts as
> Sonatype Nexus's "distribution bundle" - a ZIP file with all the
> information (poms, checksums, jars) that should be staged. This
> requires a manual upload of this ZIP file but otherwise allows
> publishing exact identical files that were part of the RC.
>
> If we only care about releasing from the same git hash (but with
> rebuilt artifacts - so some things in manifests may change!) then
> indeed it's doable via the command Jan mentioned.
>
> I don't think there exists a third way of doing this (?).
>
> I can help add a task that will assemble a Sonatype Nexus bundle which
> you'll be able to download to Nexus. It should ultimately be part of
> the release candidate artifacts - this would make it explicit what
> will get uploaded.
>
> Dawid
>
> On Mon, Dec 6, 2021 at 2:19 PM Adrien Grand <jpountz@gmail.com> wrote:
> >
> > Hello,
> >
> > The release wizard still suggests using Ant for Maven publication:
> >
> > cd ~/.lucene-releases/9.0.0/lucene
> > ant clean stage-maven-artifacts \
> >
> -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
> > \
> > -Dm2.repository.id=apache.releases.https \
> > -Dm2.repository.url=
> https://repository.apache.org/service/local/staging/deploy/maven2
> >
> > The Gradle build has a `mavenToApacheReleases` task that seems to do
> > what I want, but I can't find how to tell it to use the JARs of RC4
> > rather than those produced by `gradlew assembleRelease`. Can someone
> > help me with this?
> >
> > --
> > Adrien
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: dev-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>
Re: Maven publication with the Gradle build [ In reply to ]
> I believe maven/nexus natively allows publishing an RC to the staging repo and then manually promoting to a release. Apache infra has this dual set up for us already.
> Would gradle be able to hook into that process?

If it's the same as other open source Nexus installations then the
"staging repository" is an intermediate step that's always there -
there is no way to publish directly to releases. The question is how
do you upload to the staging repository - it's one of the methods I
mentioned in my previous e-mail.

D.

>
> On Mon, Dec 6, 2021 at 9:15 AM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>>
>> Hi Adrien,
>>
>> So. From gradle's point of view I don't think it's possible to reuse
>> exactly the same files as were present in the RC candidate.
>> Technically artifacts are a result of the build (tasks) - they can't
>> be taken arbitrarily from disk. Or rather: it may be possible but will
>> require terrible hacks.
>>
>> I suggested to Jan that we could instead package the artifacts as
>> Sonatype Nexus's "distribution bundle" - a ZIP file with all the
>> information (poms, checksums, jars) that should be staged. This
>> requires a manual upload of this ZIP file but otherwise allows
>> publishing exact identical files that were part of the RC.
>>
>> If we only care about releasing from the same git hash (but with
>> rebuilt artifacts - so some things in manifests may change!) then
>> indeed it's doable via the command Jan mentioned.
>>
>> I don't think there exists a third way of doing this (?).
>>
>> I can help add a task that will assemble a Sonatype Nexus bundle which
>> you'll be able to download to Nexus. It should ultimately be part of
>> the release candidate artifacts - this would make it explicit what
>> will get uploaded.
>>
>> Dawid
>>
>> On Mon, Dec 6, 2021 at 2:19 PM Adrien Grand <jpountz@gmail.com> wrote:
>> >
>> > Hello,
>> >
>> > The release wizard still suggests using Ant for Maven publication:
>> >
>> > cd ~/.lucene-releases/9.0.0/lucene
>> > ant clean stage-maven-artifacts \
>> > -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
>> > \
>> > -Dm2.repository.id=apache.releases.https \
>> > -Dm2.repository.url=https://repository.apache.org/service/local/staging/deploy/maven2
>> >
>> > The Gradle build has a `mavenToApacheReleases` task that seems to do
>> > what I want, but I can't find how to tell it to use the JARs of RC4
>> > rather than those produced by `gradlew assembleRelease`. Can someone
>> > help me with this?
>> >
>> > --
>> > Adrien
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> > For additional commands, e-mail: dev-help@lucene.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Maven publication with the Gradle build [ In reply to ]
Hmm do the RC builds have an RC1,RC2,etc notation in the version so one can
tell which one is running? (and if you've really restarted to the intended
version etc when testing/comparing them)? if so we'd be rebuilding anyway
to get rid of it?

On Mon, Dec 6, 2021 at 10:41 AM Dawid Weiss <dawid.weiss@gmail.com> wrote:

> > I believe maven/nexus natively allows publishing an RC to the staging
> repo and then manually promoting to a release. Apache infra has this dual
> set up for us already.
> > Would gradle be able to hook into that process?
>
> If it's the same as other open source Nexus installations then the
> "staging repository" is an intermediate step that's always there -
> there is no way to publish directly to releases. The question is how
> do you upload to the staging repository - it's one of the methods I
> mentioned in my previous e-mail.
>
> D.
>
> >
> > On Mon, Dec 6, 2021 at 9:15 AM Dawid Weiss <dawid.weiss@gmail.com>
> wrote:
> >>
> >> Hi Adrien,
> >>
> >> So. From gradle's point of view I don't think it's possible to reuse
> >> exactly the same files as were present in the RC candidate.
> >> Technically artifacts are a result of the build (tasks) - they can't
> >> be taken arbitrarily from disk. Or rather: it may be possible but will
> >> require terrible hacks.
> >>
> >> I suggested to Jan that we could instead package the artifacts as
> >> Sonatype Nexus's "distribution bundle" - a ZIP file with all the
> >> information (poms, checksums, jars) that should be staged. This
> >> requires a manual upload of this ZIP file but otherwise allows
> >> publishing exact identical files that were part of the RC.
> >>
> >> If we only care about releasing from the same git hash (but with
> >> rebuilt artifacts - so some things in manifests may change!) then
> >> indeed it's doable via the command Jan mentioned.
> >>
> >> I don't think there exists a third way of doing this (?).
> >>
> >> I can help add a task that will assemble a Sonatype Nexus bundle which
> >> you'll be able to download to Nexus. It should ultimately be part of
> >> the release candidate artifacts - this would make it explicit what
> >> will get uploaded.
> >>
> >> Dawid
> >>
> >> On Mon, Dec 6, 2021 at 2:19 PM Adrien Grand <jpountz@gmail.com> wrote:
> >> >
> >> > Hello,
> >> >
> >> > The release wizard still suggests using Ant for Maven publication:
> >> >
> >> > cd ~/.lucene-releases/9.0.0/lucene
> >> > ant clean stage-maven-artifacts \
> >> >
> -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
> >> > \
> >> > -Dm2.repository.id=apache.releases.https \
> >> > -Dm2.repository.url=
> https://repository.apache.org/service/local/staging/deploy/maven2
> >> >
> >> > The Gradle build has a `mavenToApacheReleases` task that seems to do
> >> > what I want, but I can't find how to tell it to use the JARs of RC4
> >> > rather than those produced by `gradlew assembleRelease`. Can someone
> >> > help me with this?
> >> >
> >> > --
> >> > Adrien
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> >> > For additional commands, e-mail: dev-help@lucene.apache.org
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: dev-help@lucene.apache.org
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

--
http://www.needhamsoftware.com (work)
http://www.the111shift.com (play)
Re: Maven publication with the Gradle build [ In reply to ]
Just FYI - if you want to upload the exact release maven artifacts
then you'd need to place all of the files under RC's maven/ folder in
a flattened zip file (no directories) and excluding
**/maven-metadata.*.

Then upload this file as a bundle and inspect the content, it should
show exactly the artifacts from the RC (with correct paths!) - see
attached screenshot. Once you stage them, you proceed as is typical -
close the staging repository and release. Let me know if you need any
help.

Dawid

On Mon, Dec 6, 2021 at 2:19 PM Adrien Grand <jpountz@gmail.com> wrote:
>
> Hello,
>
> The release wizard still suggests using Ant for Maven publication:
>
> cd ~/.lucene-releases/9.0.0/lucene
> ant clean stage-maven-artifacts \
> -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
> \
> -Dm2.repository.id=apache.releases.https \
> -Dm2.repository.url=https://repository.apache.org/service/local/staging/deploy/maven2
>
> The Gradle build has a `mavenToApacheReleases` task that seems to do
> what I want, but I can't find how to tell it to use the JARs of RC4
> rather than those produced by `gradlew assembleRelease`. Can someone
> help me with this?
>
> --
> Adrien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
Re: Maven publication with the Gradle build [ In reply to ]
I ended up cheating a bit and using the 8.11 Ant build to upload the
Maven artifacts to Nexus before I saw Dawid's message.

The bundle idea looks like a promising path to use for upcoming
releases. Since we require logging into Nexus anyway for promotion, it
doesn't make things worse to also do the upload via the UI?

On Mon, Dec 6, 2021 at 5:30 PM Dawid Weiss <dawid.weiss@gmail.com> wrote:
>
> Just FYI - if you want to upload the exact release maven artifacts
> then you'd need to place all of the files under RC's maven/ folder in
> a flattened zip file (no directories) and excluding
> **/maven-metadata.*.
>
> Then upload this file as a bundle and inspect the content, it should
> show exactly the artifacts from the RC (with correct paths!) - see
> attached screenshot. Once you stage them, you proceed as is typical -
> close the staging repository and release. Let me know if you need any
> help.
>
> Dawid
>
> On Mon, Dec 6, 2021 at 2:19 PM Adrien Grand <jpountz@gmail.com> wrote:
> >
> > Hello,
> >
> > The release wizard still suggests using Ant for Maven publication:
> >
> > cd ~/.lucene-releases/9.0.0/lucene
> > ant clean stage-maven-artifacts \
> > -Dmaven.dist.dir=~/.lucene-releases/9.0.0/RC4/dist/lucene-9.0.0-RC4-rev-0b18b3b965cedaf5eb129aa41243a44c83ca826d/lucene/maven
> > \
> > -Dm2.repository.id=apache.releases.https \
> > -Dm2.repository.url=https://repository.apache.org/service/local/staging/deploy/maven2
> >
> > The Gradle build has a `mavenToApacheReleases` task that seems to do
> > what I want, but I can't find how to tell it to use the JARs of RC4
> > rather than those produced by `gradlew assembleRelease`. Can someone
> > help me with this?
> >
> > --
> > Adrien
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: dev-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org



--
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: Maven publication with the Gradle build [ In reply to ]
> I ended up cheating a bit and using the 8.11 Ant build to upload the
> Maven artifacts to Nexus before I saw Dawid's message.

If ant can do it then it surely can be ported to gradle though -
perhaps worth exploring as well? If you create an issue I'll take a
look,
although I admit it's low on the priority list.

> The bundle idea looks like a promising path to use for upcoming
> releases. Since we require logging into Nexus anyway for promotion, it
> doesn't make things worse to also do the upload via the UI?

It takes one more step - if we can automate it, it'd be probably better.

D.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org