0

Tengo problema al tratar de autenticarme en Maven central al tratar de desplegar mi plugin programáticamente.

En mi archivo de configuración, settings.xml puse el tóken que me genera al iniciar sesión en el nuevo repositorio que me indicaron para maven central.

Si a alguien le interesa mi número de ticket es el https://issues.sonatype.org/browse/OSSRH-67968

Mi módulo es una aplicación open source multiplataforma desarrollada en con y es un proyecto maven multomódulo

trato de correr el comando mvn deploy lo que me produce la siguiente traza:

Installing C:\Users\Administrador.000\Documents\NetBeansProjects\regextester\client-idea\target\regextester-idea-1.0.3-SNAPSHOT-javadoc.jar.asc to C:\Users\Administrador.000\Documents\NetBeansProjects\regextester\target\nexus-staging\deferred\org\javapro\regextester-idea\1.0.3-SNAPSHOT\regextester-idea-1.0.3-SNAPSHOT-javadoc.jar.asc
Deploying remotely...
Bulk deploying locally gathered artifacts from directory: 
 * Bulk deploying locally gathered snapshot artifacts
Downloading from ossrh: https://s01.oss.sonatype.org/content/repositories/snapshots/org/javapro/regextester-nb/1.0.3-SNAPSHOT/maven-metadata.xml
Uploading to ossrh: https://s01.oss.sonatype.org/content/repositories/snapshots/org/javapro/regextester-nb/1.0.3-SNAPSHOT/regextester-nb-1.0.3-20210425.202334-1.nbm
Progress (1): 4.1/254 kB
Progress (1): 254 kB    
                    
------------------------------------------------------------------------
Reactor Summary for regextester 1.0.3-SNAPSHOT:

regextester ........................................ SUCCESS [ 26.666 s]
regextester JavaScript Libraries ................... SUCCESS [ 18.033 s]
automatonosgi ...................................... SUCCESS [  3.992 s]
generex OSGi Bundle ................................ SUCCESS [  4.865 s]
regextester General Client Code .................... SUCCESS [ 17.712 s]
regextester Client for Web ......................... SUCCESS [ 23.492 s]
regextester Client for NetBeans .................... SUCCESS [ 26.537 s]
regextester Client for Idea ........................ FAILURE [ 17.669 s]
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time:  02:21 min
Finished at: 2021-04-25T15:23:35-05:00
------------------------------------------------------------------------
Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy (injected-nexus-deploy) on project regextester-idea: Failed to deploy artifacts: Could not transfer artifact org.javapro:regextester-nb:nbm:1.0.3-20210425.202334-1 from/to ossrh (https://s01.oss.sonatype.org/content/repositories/snapshots): Transfer failed for https://s01.oss.sonatype.org/content/repositories/snapshots/org/javapro/regextester-nb/1.0.3-SNAPSHOT/regextester-nb-1.0.3-20210425.202334-1.nbm 401 Unauthorized -> [Help 1]

Partes relevantes de mi settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<server>
  <id>ossrh</id>
  <username>v1234</username>
  <password>12346</password>
</server>

<profiles>
    <profile>
        <id>ossrh</id>
        <activation>
        <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <gpg.passphrase>lacontraseñaquelepusealgpg</gpg.passphrase>
        </properties>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>jboss-public-repository</activeProfile>
    <activeProfile>Maven Central</activeProfile>
    <activeProfile>Google</activeProfile>
    <activeProfile>ossrh</activeProfile>
</activeProfiles>

Mi pom.xml del padre:

4.0.0

<groupId>org.javapro</groupId>
<artifactId>regextester-pom</artifactId>
<version>1.0.3-SNAPSHOT</version>
<packaging>pom</packaging>

<name>regextester</name>
<url>https://github.com/javatlacati/regextester</url>
<modules>
    <module>js</module>
    <module>automatonosgi</module>
    <module>generex</module>
    <module>client</module>
    <module>client-web</module>
    <module>client-netbeans</module>
    <module>client-idea</module>
</modules>
<properties>
    <net.java.html.version>1.7.1</net.java.html.version>
    <openjfx.version>16</openjfx.version>
    <bck2brwsr.version>0.32</bck2brwsr.version>
    <bck2brwsr.obfuscationlevel>MINIMAL</bck2brwsr.obfuscationlevel>
    <junit.browser.version>1.0</junit.browser.version>
    <jersey.version>2.13</jersey.version>
    <presenters.version>1.7.1</presenters.version>
    <enforcer.fail>false</enforcer.fail>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <idea.version>2020.1.4</idea.version>
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.dukescript.api</groupId>
            <artifactId>junit-osgi</artifactId>
            <scope>test</scope>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>com.dukescript.api</groupId>
            <artifactId>junit-browser-runner</artifactId>
            <version>${junit.browser.version}</version>
            <scope>test</scope>
            <type>jar</type>
            <exclusions>
                <exclusion>
                    <groupId>org.netbeans.html</groupId>
                    <artifactId>net.java.html</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.netbeans.html</groupId>
                    <artifactId>net.java.html.boot</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apidesign.bck2brwsr</groupId>
                    <artifactId>emul</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</dependencyManagement>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.4.1</version>
            <executions>
                <execution>
                    <id>enforce-versions</id>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <DependencyConvergence/>
                        </rules>
                        <fail>${enforcer.fail}</fail>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.6</version>
            <executions>
                <execution>
                    <id>prepare-agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <excludes>
                    <exclude>**/**/RegexTesting*</exclude>
                </excludes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>4.3.0</version>
            <dependencies>
                <dependency>
                  <groupId>javax.xml.bind</groupId>
                  <artifactId>jaxb-api</artifactId>
                  <version>2.3.1</version>
                </dependency>
            </dependencies>
            <configuration>
                <repoToken>${env.repoToken}</repoToken>
                <sourceEncoding>UTF-8</sourceEncoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.9.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.1.1</version>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>2.0.0</version>
            <executions>
                <execution>
                    <id>downloadIC</id>
                    <phase>validate</phase>
                    <goals><goal>download-single</goal></goals>
                    <configuration>
                        <url>https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/${idea.version}/</url>
                        <fromFile>ideaIC-${idea.version}.zip</fromFile>
                        <toFile>${project.basedir}/client-idea/lib/ideaIC-${idea.version}.zip</toFile>
                        <skipIfExists>true</skipIfExists>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.8</version>
            <executions>
                <execution>
                    <id>prepare</id>
                    <phase>validate</phase>
                    <configuration>
                        <tasks>
                            <echo message="unzipping file ${project.basedir}/client-idea/lib/ideaIC-${idea.version}.zip to ${project.basedir}/client-idea/lib" />
                            <unzip src="${project.basedir}/client-idea/lib/ideaIC-${idea.version}.zip" dest="${project.basedir}/client-idea/lib" overwrite="false" />
                        </tasks>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <!-- generate source code jar -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <!-- generate documentation jar -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
        </plugin>
    
        <!-- plugins for releasing to maven central -->
        <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
                <serverId>ossrh</serverId>
                <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
        </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>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
                <autoVersionSubmodules>true</autoVersionSubmodules>
                <useReleaseProfile>false</useReleaseProfile>
                <releaseProfiles>release</releaseProfiles>
                <goals>deploy</goals>
            </configuration>
        </plugin>
    </plugins> 
</build>

<developers>
    <developer>
        <name>Ruslan Lopez Carro</name>
        <id>javatlacati</id>
        <email>mi correo</email>
        <timezone>-6</timezone>
        <roles>
            <role>Project Founder</role>
            <role>Developer</role>
            <role>Mantainer</role>
        </roles>
    </developer>
</developers>

<issueManagement>
    <url>https://github.com/javatlacati/regextester/issues</url>
    <system>GitHub Issues</system>
</issueManagement>

<licenses>
    <license>
        <name>GNU General Public License v3.0</name>
        <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
        <distribution>manual</distribution>
        <comments>
        </comments>
    </license>

</licenses>

 <scm>
    <url>https://github.com/javatlacati/regextester</url>
    <connection>scm:git:git://github.com/javatlacati/regextester.git</connection>
    <developerConnection>scm:git:[email protected]:javatlacati/regextester.git</developerConnection>
    <tag>regextester-1.0.3-SNAPSHOT</tag>
</scm>

<profiles>
    <profile>
        <id>releases</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

<distributionManagement>
    <snapshotRepository>
        <id>ossrh</id>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
        <id>ossrh</id>
        <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
</distributionManagement>

cabe mencionar que lo corro conforma a las instrucciones para desplegar como snapshot que proporcionan oficialmente

es decir:

mvn clean deploy

1 respuesta 1

0

Tu problema es que estás tratando de subir un SNAPSHOT a Maven Central. Solo puedes subir versiones de RELEASE (ergo, sin el sufijo SNAPSHOT).

1
  • ya agregué en la pregunta el enlace a las instrucciondes de como desplegar como snapshot en maven central, lo cual ha sido posible desde siempre Commented el 1 may. 2021 a las 22:00

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.