-
Notifications
You must be signed in to change notification settings - Fork 3
Troubleshooting and workarounds
c8y3 edited this page Sep 26, 2023
·
7 revisions
Release build failure If the deploy phase of a release build failed and the jar is not present on maven central, it may still recover after a few hours. Check the presence of the jar both on maven central and nexus:
- https://central.sonatype.com/artifact/com.airbus-cyber-security.graylog/graylog-plugin-correlation-count
- https://repo1.maven.org/maven2/com/airbus-cyber-security/graylog/graylog-plugin-correlation-count/
- https://oss.sonatype.org/#nexus-search;quick~graylog-plugin-correlation-count
If the staging was successful but the release not executed, the following pipeline can be executed to release:
name: Continuous Integration
on: push
env:
JAVA_VERSION: 17
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: plugin
- name: Releasing to Maven Central
working-directory: plugin
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
echo -n "$GPG_PRIVATE_KEY" | gpg2 --batch --allow-secret-key-import --import
mvn org.sonatype.plugins:nexus-staging-maven-plugin:release -DstagingRepositoryId=comairbus-cyber-securitygraylog-1099 --settings deployment/settings.xml
You may then need to remove the last commit (this should be avoided):
git reset --hard HEAD^
git push --force
If the maven central publication completely fails, it is always possible to publish jars in the local repository cache. But that's a workaround to achieve local builds only.
mvn install:install-file -Dfile=target/graylog-plugin-logging-alert-4.0.0.jar -DgroupId=com.airbus-cyber-security.graylog -DartifactId=graylog-plugin-logging-alert -Dversion=4.0.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
mvn install:install-file -Dfile=target/graylog-plugin-correlation-count-4.0.0.jar -DgroupId=com.airbus-cyber-security.graylog -DartifactId=graylog-plugin-correlation-count -Dversion=4.0.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
- Check the error is the following
SEVERE: A message body reader for Java class com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO, and Java type class com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO, and MIME media type text/html was not found
- log in https://oss.sonatype.org/#stagingRepositories
- and follow the direction given there https://help.sonatype.com/repomanager2/staging-releases/managing-staging-repositories