Status code: 401, reason phrase: Unauthorized (401)

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 corporate 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:


4.0.0

io.github.pizzadox9999
radp-for-gwtswing
0.0.1-SNAPSHOT

war

11 0.9.2 UTF-8

RADP for GWTSwing
Most critical stuff missing in GWTSwing provided here.
GitHub - pizzadox9999/RADP_for_GWTSwing: A rapid application development platform for GWTSwing.

GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html pizzadox9999 hanzmeier70@web.de github github.com scm:git:git://github.com/pizzadox9999/RADP_for_GWTSwing.git scm:git:ssh://github.com:pizzadox9999/RADP_for_GWTSwing.git https://github.com/pizzadox9999/RADP_for_GWTSwing ossrh https://s01.oss.sonatype.org/content/repositories/snapshots ossrh https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ de.exware de.exware.gwtswing 0.0.1-SNAPSHOT de.exware de.exware.gplatform.teavm 0.0.1-SNAPSHOT
<!-- Emulator of Java class library for TeaVM -->
<dependency>
  <groupId>org.teavm</groupId>
  <artifactId>teavm-classlib</artifactId>
  <version>${teavm.version}</version>
  <scope>provided</scope>
</dependency>

<!-- JavaScriptObjects (JSO) - a JavaScript binding for TeaVM -->
<dependency>
  <groupId>org.teavm</groupId>
  <artifactId>teavm-jso-apis</artifactId>
  <version>${teavm.version}</version>
  <scope>provided</scope>
</dependency>
maven-compiler-plugin 3.1 ${java.version} ${java.version}
  <!-- Configure WAR plugin to include JavaScript files generated by TeaVM -->
  <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>

  <!-- Configure TeaVM -->
  <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>
          <!-- Directory where TeaVM should put generated files. This configuration conforms to the settings
               of the WAR plugin -->
          <targetDirectory>${project.build.directory}/generated/js/teavm</targetDirectory>

          <!-- Main class, containing static void main(String[]) -->
          <mainClass>org.radp.Test</mainClass>

          <!-- Whether TeaVM should produce minified JavaScript. Can reduce JavaScript file size more than
               two times -->
          <minifying>false</minifying>

          <!-- Whether TeaVM should produce debug information for its built-in debugger -->
          <debugInformationGenerated>true</debugInformationGenerated>

          <!-- Whether TeaVM should produce source maps file -->
          <sourceMapsGenerated>true</sourceMapsGenerated>

          <!-- Whether TeaVM should also put source files into output directory,
               for compatibility with source maps -->
          <sourceFilesCopied>true</sourceFilesCopied>

          <!-- Optimization level. Valid values are: SIMPLE, ADVANCED, FULL -->
          <optimizationLevel>ADVANCED</optimizationLevel>
          
          <!-- EXPERIMENTAL configuration options -->
          <!--<incremental>true</incremental>  builds the javascript incrementally with a cache-->              
        </configuration>
      </execution>
    </executions>
  </plugin>
  
  <!-- deploy plugins-->
  <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>

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

org.apache.maven.lifecycle.LifecycleExecutionException: 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

at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:333)

at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)

at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)

at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)

at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)

at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)

at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)

at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)

at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)

at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)

at java.base/java.lang.reflect.Method.invoke(Method.java:580)

at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)

at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)

at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)

Caused by: org.apache.maven.plugin.MojoExecutionException: Failed 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)

at org.sonatype.nexus.maven.staging.deploy.DeployMojo.execute(DeployMojo.java:216)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)

at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)

… 23 more

Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed 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)

at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:133)

at org.sonatype.nexus.maven.staging.deploy.strategy.AbstractDeployStrategy.deployUp(AbstractDeployStrategy.java:213)

at org.sonatype.nexus.maven.staging.deploy.strategy.DeferredDeployStrategy.finalizeDeploy(DeferredDeployStrategy.java:86)

at org.sonatype.nexus.maven.staging.deploy.DeployMojo.execute(DeployMojo.java:213)

… 25 more

Caused by: org.eclipse.aether.deployment.DeploymentException: Failed 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)

at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:278)

at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:202)

at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:393)

at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:131)

… 28 more

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: 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)

at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:44)

at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:417)

at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:297)

at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:271)

… 31 more

Caused by: org.apache.http.client.HttpResponseException: status code: 401, reason phrase: Unauthorized (401)

at org.eclipse.aether.transport.http.HttpTransporter.handleStatus(HttpTransporter.java:610)

at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:479)

at org.eclipse.aether.transport.http.HttpTransporter.implPut(HttpTransporter.java:460)

at org.eclipse.aether.spi.connector.transport.AbstractTransporter.put(AbstractTransporter.java:107)

at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:564)

at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:414)

… 33 more

Hi this isn’t the right forum and I don’t have the ability to move posts. You’d want to ask your question in Central forum.

Hi, it is solved. How can I close/delete this topic?