blackears / svgSalamander

155 stars 56 forks source link

config pom.xml to deploy to maven central #40

Closed nidi3 closed 5 years ago

blackears commented 5 years ago

Thanks for the patch. Would you have any advice on how I'd actually deploy this to central? I've not had much luck with deploying on Maven in the past.

nidi3 commented 5 years ago

As described in https://github.com/blackears/svgSalamander/issues/9, you must generate and publish a pgp keypair https://central.sonatype.org/pages/working-with-pgp-signatures.html, then simply execute mvn deploy -Pdeploy

blackears commented 5 years ago

I tried deploying with your updated pom, but am getting the below error message when I try to deploy. Would you know how I could fix this?

[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project svgSalamander: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy failed: Server credentials with ID "ossrh" not found! -> [Help 1]

nidi3 commented 5 years ago

I forgot, you have to add your account for https://issues.sonatype.org to your ~/.m2/settings.xml:

 <servers>
        <server>
            <id>ossrh</id>
            <username>...</username>
            <password>...</password>
        </server>
blackears commented 5 years ago

I tried again. I got further, but encountered another error:

[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project svgSalamander: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy failed: 403 - Forbidden -> [Help 1]

Running again with the -e flag gives further info:

[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project svgSalamander: Remote staging failed: Staging rules failure! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project svgSalamander: Remote staging failed: Staging rules failure!
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
nidi3 commented 5 years ago

That's strange. Is there any hint as to what staging rules failed? Maybe when you try running it with -X flag, there's even more information.

nidi3 commented 5 years ago

I see your try on https://oss.sonatype.org/#stagingRepositories with id central_bundles-16894. Maybe you can try releasing from there and hope for a better error message.

blackears commented 5 years ago

Trying to release using Sonatype's web interface results in the same generic error message:

Release failed

Nexus returned an error: ERROR 403: Forbidden

nidi3 commented 5 years ago

Just to be sure, do you have the rights for com.kitfox? On the same sonatype page, when you select "Central Statistics" from the left hand menu, then in the "project" dropdown, do you see com.kitfox as an option?

blackears commented 5 years ago

The project dropdown has no entries in it.

nidi3 commented 5 years ago

Sometimes it takes some time till it's ready. Did you request access to com.kitfox via sonatype's jira? If yes, you could ask them what's the problem.

blackears commented 5 years ago

Not sure. If I have, it was years ago when I first set up the account.

blackears commented 5 years ago

How would I go about requesting access?

nidi3 commented 5 years ago

Here is the complete guide: https://central.sonatype.org/pages/ossrh-guide.html And what my own jira ticket looked like: https://issues.sonatype.org/browse/OSSRH-9801