Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [starter-dev] [jakarta.ee-community] [EXTERNAL] Re: Publishing to maven central

Hi,


I have created a release branch, tagged a release, and set up the jobs to stage the artifact. 
An issue with helpdesk has been filed to get the correct credentials set up: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1070
When this is fixed, I will run the staging job to make the archetype available from the Jakarta Staging nexus.

I also created a release record and requested a release review for April 20.

https://projects.eclipse.org/projects/ee4j.starter/releases/1.0.0

Ivar


On Thu, Mar 24, 2022 at 5:22 PM Ivar Grimstad <ivar.grimstad@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,

I have some time to get this started tomorrow. When I have created the release record, I'll paste the link here for everyone to review. Then we can decide on the steps to follow.

Ivar

On Thu, Mar 24, 2022 at 5:08 PM Reza Rahman <reza_rahman@xxxxxxxxx> wrote:

Chimed in. Hopefully it will be sorted soon so you can at least do the staging and see if we need more changes.

On 3/24/2022 9:47 AM, Jeyvison Nascimento wrote:
Hi Reza,

I'm waiting for https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1000 to be resolved so I can create the scripts for publishing the archetype.

Em qui., 24 de mar. de 2022 às 13:38, <reza_rahman@xxxxxxxxx> escreveu:
Jeyvison/Ivar,

Any updates on this? Anything I can do to expedite matters?

In the meanwhile, I now have GlassFish working on my fork, proving out the easy dynamism of the Maven Archetype approach: https://github.com/m-reza-rahman/starter. I’ll push that after the GitHub Pages update. Do review if you can.

I’ll keep working on adding support for other runtimes like WildFly, Open Liberty and TomEE. Once all the major ones are done, I think we can do a second major release?

Cheers,
Reza Rahman
Jakarta EE Ambassador, Author, Blogger, Speaker

Please note views expressed here are my own as an individual community member and do not reflect the views of my employer.
 

From: jakarta.ee-community <jakarta.ee-community-bounces@eclipseorg> on behalf of arjan tijms <arjan.tijms@xxxxxxxxx>
Sent: Wednesday, March 16, 2022 9:55 AM
To: Jakarta EE community discussions <jakarta.ee-community@xxxxxxxxxxx>
Cc: starter developer discussions <starter-dev@xxxxxxxxxxx>
Subject: Re: [jakarta.ee-community] [starter-dev] [EXTERNAL] Re: Publishing to maven central
 
Hi,

On Wed, Mar 16, 2022 at 12:10 PM Jeyvison Nascimento <jeynoronha@xxxxxxxxx> wrote:

We had an issue once to give all other ee4j members read access for other CIs for the ee4j projects, but seemingly that is some manual thing then that must be periodically updated.

 
Can you give me read permission or send the script so we can use it in starter ci?

The scripts are:

#!/bin/bash -e
 
 gpg --batch --import ${KEYRING}
 for fpr in $(gpg --list-keys --with-colons  | awk -F: '/fpr:/ {print $10}' | sort -u);
 do
   echo -e "5\ny\n" |  gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
 done

#!/bin/bash -e

# Setup jaspic bot account information
git config --global user.email "authentication-bot@xxxxxxxxxxx"
git config --global user.name "Eclipse authentication Bot"

#!/bin/bash -ex

MVN_HOME="/opt/tools/apache-maven/latest"
JAVA_HOME="/opt/tools/java/oracle/jdk-8/latest"
PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Maven plugins
MVN_EXTRA='--batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
MAVEN_SKIP_RC=1

if [ ${DROP_FIRST} = 'true' ]; then
    mvn ${MVN_EXTRA} nexus-staging:rc-drop -DstagingRepositoryId=${DROP_ID}
    exit 0
fi

if [ ${LIST_FIRST} = 'true' ]; then
    mvn ${MVN_EXTRA} nexus-staging:rc-list
    mvn ${MVN_EXTRA} nexus-staging:rc-list-profiles
    exit 0
fi

#!/bin/bash -ex
if [ ${DROP_FIRST} = 'true' ] || [ ${LIST_FIRST} = 'true' ]; then
   exit 0
fi


MVN_HOME="/opt/tools/apache-maven/latest"
JAVA_HOME="/opt/tools/java/openjdk/jdk-11/latest"

PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Maven plugins
VERSIONS_PLUGIN='org.codehaus.mojo:versions-maven-plugin:2.5'
HELP_PLUGIN='org.apache.maven.plugins:maven-help-plugin:2.1.1'
MVN_EXTRA='--batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
MAVEN_SKIP_RC=1

# Directory with project top level pom.xml
BUILD_DIR="${WORKSPACE}/api"

cd ${BUILD_DIR}


# Check whether top level pom.xml contains SNAPSHOT version
if ! grep '<version>' pom.xml | grep 'RC' ; then
  echo '-[ Not an RC version ]-------------------------------------------'
   
  # Check whether top level pom.xml contains SNAPSHOT version
  if ! grep '<version>' pom.xml | grep 'SNAPSHOT' ; then
    echo '-[ Missing SNAPSHOT version in POM! ]-------------------------------------------'
    exit 1
  fi
 
  # Compute release versions
  SNAPSHOT_VERSION=`mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.version 2> /dev/null | grep -E '^[0-9]+(\.[0-9]+)+-SNAPSHOT$'`
 
  if [ -z "${RELEASE_VERSION}" ]; then
    if [ -z ${SNAPSHOT_VERSION} ]; then
      echo '-[ Missing required snapshot version number! ]----------------------------------'
    fi
    RELEASE_VERSION=`echo ${SNAPSHOT_VERSION} | sed -e 's/-SNAPSHOT//'`
  fi
 
  # Bash specific code
  if [ -z "${NEXT_VERSION}" ]; then
    NEXT_VERSION=`echo ${RELEASE_VERSION} | sed -e 's/\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
    set -f
    NEXT_COMPONENTS=(${RELEASE_VERSION//\./ })
    LAST_INDEX=$((${#NEXT_COMPONENTS[@]} - 1))
    NEXT_COMPONENTS[${LAST_INDEX}]=$((${NEXT_COMPONENTS[${LAST_INDEX}]} + 1))
    NEXT_VERSION=`echo ${NEXT_COMPONENTS[@]} | tr ' ' '.'`'-SNAPSHOT'
  fi
else
  SNAPSHOT_VERSION=`mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.version 2> /dev/null | grep -E '^[0-9]+(\.[0-9]+)+-RC[0-9]+$'`
  RELEASE_VERSION=${SNAPSHOT_VERSION}
  NEXT_VERSION=${SNAPSHOT_VERSION}
fi

RELEASE_TAG="${RELEASE_VERSION}-RELEASE"

echo "Current version: ${SNAPSHOT_VERSION}"
echo "Release version: ${RELEASE_VERSION}"
echo "Next version:    ${NEXT_VERSION}"
echo "Release tag:     ${RELEASE_TAG}"

if [ -z "${SNAPSHOT_VERSION}" -o -z "${RELEASE_VERSION}" -o -z "${NEXT_VERSION}" ]; then
  echo '-[ Missing required version numbers! ]------------------------------------------'
  exit 1
fi

if [ ${DRY_RUN} = 'true' ]; then
  echo '-[ Dry run turned on ]----------------------------------------------------------'
  MVN_DEPLOY_ARGS=''
  echo '-[ Skipping GitHub branch and tag checks ]--------------------------------------'
else
  # MVN_DEPLOY_ARGS='deploy:deploy'
  MVN_DEPLOY_ARGS='nexus-staging:deploy'
  GIT_ORIGIN=`git remote`
 
  echo '-[ Prepare branch ]-------------------------------------------------------------'
  if [[ -n `git branch -r | grep "${GIT_ORIGIN}/${RELEASE_VERSION}"` ]]; then
    if [ "${OVERWRITE}" = 'true' ]; then
      echo "${GIT_ORIGIN}/${RELEASE_VERSION} branch already exists, deleting"
      git push --delete origin "${RELEASE_VERSION}" && true
    else
      echo "Error: ${GIT_ORIGIN}/${RELEASE_VERSION} branch already exists"
      exit 1
    fi
  fi
 
  echo '-[ Release tag cleanup ]--------------------------------------------------------'
  if [[ -n `git ls-remote --tags ${GIT_ORIGIN} | grep "${RELEASE_TAG}"` ]]; then
    if [ "${OVERWRITE}" = 'true' ]; then
      echo "${RELEASE_TAG} tag already exists, deleting"
      git push --delete origin "${RELEASE_TAG}" && true
    else
      echo "Error: ${RELEASE_TAG} tag already exists"
      exit 1
    fi
  fi
fi

cd ${WORKSPACE}

# Always delete local branch if exists
git branch --delete "${RELEASE_VERSION}" && true
git checkout -b ${RELEASE_VERSION}

# Always delete local tag if exists
git tag --delete "${RELEASE_TAG}" && true



cd ${BUILD_DIR}

# Project identifiers
ARTIFACT_ID=$(mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.artifactId | grep -Ev '(^\[)')
GROUP_ID=$(mvn ${MVN_EXTRA} -B ${HELP_PLUGIN}:evaluate -Dexpression=project.groupId | grep -Ev '(^\[)')



if [ ${SNAPSHOT_VERSION} != ${RELEASE_VERSION} ]; then
  echo '-[ Set release version ]--------------------------------------------------------'
 
  # Set release version
  mvn -U -C \
      -DnewVersion="${RELEASE_VERSION}" \
      -DgenerateBackupPoms=false \
      clean ${VERSIONS_PLUGIN}:set ${MVN_EXTRA}
 
  cd ${WORKSPACE}
 
  echo '-[ Commit modified pom.xml files ]----------------------------------------------'
  POM_FILES=`git status | grep -E 'modified:.*pom\.xml' | sed -e 's/[[:space:]][[:space:]]*modified:[[:space:]][[:space:]]*//'`
  git add ${POM_FILES} && \
  git commit -m "Prepare release ${GROUP_ID}:${ARTIFACT_ID}:${RELEASE_VERSION}"
fi



echo '-[ Deploy artifacts to staging repository ]-------------------------------------'
cd ${BUILD_DIR}
mvn -U -C -s /home/jenkins/.m2/settings.xml \
    -DskipTests -Ddoclint=none -Poss-release \
    clean package \
    gpg:sign install:install \
    ${MVN_DEPLOY_ARGS} ${MVN_EXTRA}
   
# Typical output of this step:
#  * Remote staging into staging profile ID "6f25e242715ce0"
#  * Created staging repository with ID "jakartasecurityauthmessage-1003".
#  * Staging repository at https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/jakartasecurityauthmessage-1003
#  * Uploading locally staged artifacts to profile jakarta.security.auth.message
#  * Upload of locally staged artifacts finished.
#  * Closing staging repository with ID "jakartasecurityauthmessage-1003".



echo '-[ Tag release ]----------------------------------------------------------------'
cd ${WORKSPACE}
git tag "${RELEASE_TAG}" -m "Release ${GROUP_ID}:${ARTIFACT_ID}:${RELEASE_VERSION}"


cd ${BUILD_DIR}
if [ ${SNAPSHOT_VERSION} != ${NEXT_VERSION} ]; then
  echo '-[ Set next snapshot version ]--------------------------------------------------'
  mvn -U -C \
      -DnewVersion="${NEXT_VERSION}" \
      -DgenerateBackupPoms=false \
      clean ${VERSIONS_PLUGIN}:set ${MVN_EXTRA}
 
  cd ${WORKSPACE}
 
  echo '-[ Commit modified pom.xml files ]----------------------------------------------'
  POM_FILES=`git status | grep -E 'modified:.*pom\.xml' | sed -e 's/[[:space:]][[:space:]]*modified:[[:space:]][[:space:]]*//'`
  git add ${POM_FILES} && \
  git commit -m "Prepare next development cycle for ${NEXT_VERSION}"
fi


GIT_STATUS=`git status`

echo $GIT_STATUS

if [ ${DRY_RUN} = 'true' ]; then
  echo '-[ Skipping GitHub update ]-----------------------------------------------------'
else
  echo '-[ Push branch and tag to GitHub ]----------------------------------------------'
  git push origin "${RELEASE_VERSION}"
  git push origin "${RELEASE_TAG}"
fi



Screenshot 2022-03-16 at 14.40.38png
Screenshot 2022-03-16 at 14.40.54.png
Screenshot 2022-03-16 at 14.41.10.png
Screenshot 2022-03-16 at 14.41.31.png
Screenshot 2022-03-16 at 14.41.49.png


 

This is the error i'm getting:
Screenshot 2022-03-16 at 11.08.18.png



Em qua., 16 de mar. de 2022 às 10:30, Ivar Grimstad <ivar.grimstad@xxxxxxxxxxxxxxxxxxxxxx> escreveu:
Just remember to engage in a release review (EDP before publishing any releases...

Ivar

On Wed, Mar 16, 2022 at 12:31 AM <reza_rahman@xxxxxxxxx> wrote:
Thanks, I will research it and let you know if I have further questions.
 

From: jakarta.ee-community <jakarta.ee-community-bounces@xxxxxxxxxxx> on behalf of arjan tijms <arjan.tijms@xxxxxxxxx>
Sent: Tuesday, March 15, 2022 7:28 PM
To: Jakarta EE community discussions <jakarta.ee-community@xxxxxxxxxxx>
Cc: starter developer discussions <starter-dev@xxxxxxxxxxx>
Subject: [EXTERNAL] Re: [jakarta.ee-community] [starter-dev] Publishing to maven central
 
Hi,

This can be done via the CI instance associated with the ee4j.starter project. The instance is available at https://ci.eclipse.org/starter/

You can then create a job to stage it to https://jakarta.oss.sonatype.org/content/repositories/staging/, where it's easiest to copy an existing job. They are all roughly the same, but just as an example:


If you're happy with the staging, you can push it to central using another job like:


Hope this helps.

Kind regards,
Arjan Tijms



On Mon, Mar 14, 2022 at 11:03 PM Reza Rahman <reza_rahman@xxxxxxxxx> wrote:

Looping in the Jakarta EE Community alias. This should be a well trodden path. There should be templates and guidelines we can just follow?

On 3/14/22 5:39 PM, Jeyvison Nascimento wrote:
Hi Everyone.

As some of you know, we now have an archetype for generating a Jakarta EE project. Thanks,Reza!

The next step would be to publish it to maven central so it can be used.

Do any of you know how we should proceed with that?


--
Jeyvison Nascimento

_______________________________________________
starter-dev mailing list
starter-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/starter-dev
_______________________________________________
jakarta.ee-community mailing list
jakarta.ee-community@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakarta.ee-community
_______________________________________________
starter-dev mailing list
starter-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/starter-dev


--

Ivar Grimstad

Jakarta EE Developer Advocate | Eclipse Foundation Eclipse Foundation - Community. Code. Collaboration. 

_______________________________________________
starter-dev mailing list
starter-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/starter-dev


--
Jeyvison Nascimento
_______________________________________________
jakarta.ee-community mailing list
jakarta.ee-community@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakarta.ee-community
_______________________________________________
starter-dev mailing list
starter-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/starter-dev


--
Jeyvison Nascimento

_______________________________________________
starter-dev mailing list
starter-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/starter-dev
_______________________________________________
starter-dev mailing list
starter-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/starter-dev


--

Ivar Grimstad

Jakarta EE Developer Advocate | Eclipse Foundation Eclipse Foundation - Community. Code. Collaboration. 



--

Ivar Grimstad

Jakarta EE Developer Advocate | Eclipse Foundation Eclipse Foundation - Community. Code. Collaboration. 


Back to the top