Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ee4j-build] how to release staged artifacts?

Romain Grécourt wrote on 10/12/18 01:06 PM:
There's way too many options and choices there.  I'm really hoping someone else who really understands this stuff has figured out exactly how to do this for our Eclipse projects.


            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                </configuration>
            </plugin>

You can configure the plugin to automatically release the staging repository (autoReleaseAfterClose=true).
I.e, this makes the nexus workflow transparent.
I assume we don't want to do this because we need to wait for Release Review approval before releasing the staged artifacts.

You could also implement the workflow manually. (skipStagingRepositoryClose=true)
I assume this is what we want.  Is this not the default?

It would look like something like this:

# Create the nexus staging repository
STAGING_DESC="Project ACME v${FULL_VERSION}"
mvn nexus-staging:rc-open \
  -DstagingProfileId=6026dab46eed94 \
  -DstagingDescription="${STAGING_DESC}"
Where does the stagingProfileId come from?

How often do I need to create the staging repository?  Once ever?  Every time I want to stage something new?

STAGING_REPO_ID=$(mvn nexus-staging:rc-list | \
  egrep "^\[INFO\] orgacme\-[0-9]+[ ]+OPEN[ ]+${STAGING_DESC}" | \
  awk '{print $2}' | head -1)
What is "orgacme" above?

# Perform deployment
mvn deploy -DstagingRepositoryId=${STAGING_REPO_ID}

# Close and release the nexus staging repository
mvn nexus-staging:rc-close nexus-staging:rc-release \
  -DstagingRepositoryId=${STAGING_REPO_ID} \
  -DstagingDescription="${STAGING_DESC}"
Can I put the above in a Jenkins job separate from the "mvn deploy" command?  I'm not clear on what the lifetime is of the value in STAGING_REPO_ID.  If I compute it once in the "mvn deploy" job and again in the "rc-release" job, will it have the same value?


Back to the top