Status code: 401, reason phrase: Unauthorized (401) - Central Repository - Sonatype Community
Status code: 401, reason phrase: Unauthorized (401)
post by hanzmeier70 on Mar 22, 2024
Hi Sonatype community,
I am sorry, but I can’t anymore. After following the article on how to publish to maven central, maven deploy still refuses to cooperate with me. To my setup: I have a settings.xml file with the tokens generated by sonatype.com But those wont work on the Nexus Repository Manager. Where can I create an account for this site? I appended the error log and because new users can’t upload anything I appended my pom.xml also here.
Any constructive and targeted help is very welcome!
Best regards pizzadox9999
POM.XML:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.pizzadox9999</groupId>
<artifactId>radp-for-gwtswing</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<java.version>11</java.version>
<teavm.version>0.9.2</teavm.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<name>RADP for GWTSwing</name>
<description>Most critical stuff missing in GWTSwing provided here.</description>
<url>https://github.com/pizzadox9999/RADP_for_GWTSwing</url>
<licenses>
<license>
<name>GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999</name>
<url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/pizzadox9999/RADP_for_GWTSwing.git</connection>
<developerConnection>scm:git:ssh://github.com:pizzadox9999/RADP_for_GWTSwing.git</developerConnection>
<url>https://github.com/pizzadox9999/RADP_for_GWTSwing</url>
</scm>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>de.exware</groupId>
<artifactId>de.exware.gwtswing</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exware</groupId>
<artifactId>de.exware.gplatform.teavm</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-classlib</artifactId>
<version>${teavm.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.teavm</groupId>
<artifactId>teavm-jso-apis</artifactId>
<version>${teavm.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}/generated/js</directory>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.teavm</groupId>
<artifactId>teavm-maven-plugin</artifactId>
<version>${teavm.version}</version>
<executions>
<execution>
<id>web-client</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<targetDirectory>${project.build.directory}/generated/js/teavm</targetDirectory>
<mainClass>org.radp.Test</mainClass>
<minifying>false</minifying>
<debugInformationGenerated>true</debugInformationGenerated>
<sourceMapsGenerated>true</sourceMapsGenerated>
<sourceFilesCopied>true</sourceFilesCopied>
<optimizationLevel>ADVANCED</optimizationLevel>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.4.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<tokenAuth>true</tokenAuth>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Error log:
[ERROR] Failed to execute goal e[32morg.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploye[m e[1m(injected-nexus-deploy)e[m on project e[36mradp-for-gwtswinge[m: e[1;31mFailed to deploy artifacts: Could not transfer artifact io.github.pizzadox9999:radp-for-gwtswing:war.asc:0.0.1-20240323.014835-1 from/to ossrh ( Index of /repositories/snapshots): status code: 401, reason phrase: Unauthorized (401)e[m → e[1m[Help 1]e[m