提交jar到Maven仓库问题ReasonPhrase: Forbidden

发布于 2021-12-07 23:58:45 字数 7692 浏览 832 评论 8

@ 阿信sxq

先给出配置文件内容

1.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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>cn.xsshome</groupId>
  <artifactId>taip</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>
  <url>http://maven.apache.org</url>
  <description>taip</description>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>
	</properties>
  <licenses>
		<license>
			<name>The Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
  </licenses>
  
  	<scm>
        <url>https://gitee.com/xshuai/taip.git</url>
    </scm>
    
    <developers>
		<developer>
			<name>xiaoshuai</name>
			<email>youngxiaoshuai@163.com</email>
			<organization>xsshome</organization>
			<organizationUrl>https://www.xsshome.cn</organizationUrl>
		</developer>
	</developers>  
	
	<dependencies> </dependencies>
	 <build>
        <plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</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>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
	<distributionManagement>
		<snapshotRepository>
			<id>taip</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
		</snapshotRepository>
		<repository>
			<id>taip</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>
<profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>taip</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>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

2.maven-settings.xml 用户名和密码确认无误。

https://issues.sonatype.org/

https://oss.sonatype.org/

用户名和密码登录这2个网站都正常

<servers>
    <server>
      <id>taip</id>
      <username>xiaoshuai</username>
      <password>mypwd</password>
    </server>
</servers>

3.gpg查看也正常

gpg: key 86C21110EACF407B: "xiaoshuai <youngxiaoshuai@163.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

4.ISSUE网站状态

5.发布cmd返回的信息 错误提示:ReasonPhrase: Forbidden

[INFO] Building jar: E:workspacetaiptargettaip-1.0.0-javadoc.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ taip ---
[INFO] Installing E:workspacetaiptargettaip-1.0.0.jar to E:repositorycnxsshometaip1.0.0tai
p-1.0.0.jar
[INFO] Installing E:workspacetaippom.xml to E:repositorycnxsshometaip1.0.0taip-1.0.0.pom
[INFO] Installing E:workspacetaiptargettaip-1.0.0-sources.jar to E:repositorycnxsshometaip1
.0.0taip-1.0.0-sources.jar
[INFO] Installing E:workspacetaiptargettaip-1.0.0-javadoc.jar to E:repositorycnxsshometaip1
.0.0taip-1.0.0-javadoc.jar
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ taip ---
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/xsshome/taip/1.0.0/taip-1
.0.0.jar
Uploading: https://oss.sonatype.org/service/local/staging/deploy/maven2/cn/xsshome/taip/1.0.0/taip-1
.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.199 s
[INFO] Finished at: 2018-04-16T11:32:47+08:00
[INFO] Final Memory: 26M/300M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-depl
oy) on project taip: Failed to deploy artifacts: Could not transfer artifact cn.xsshome:taip
              

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

画骨成沙 2021-12-08 19:07:52

有时差的。你今天问了明天才能得到回复。你看我的这个问题采纳的答案。有我咨询和官方给的回复。

北笙凉宸 2021-12-08 19:02:28

你在那儿问的,我都看见他们回复别,和审核我心的Issue,就是没回我的评论啊,兄弟指条明路.....

自此以后,行同陌路 2021-12-08 18:33:50

直接评论。反正应该是有时差的

路还长,别太狂 2021-12-08 17:49:12

还是直接在之前的Issue下评论?

 

睫毛上残留的泪 2021-12-08 17:18:52

好的,谢谢

野心澎湃 2021-12-08 11:34:50

解决了呀。首先要确定密码是否正确。如果正确那就咨询官方人员。让给开权限。反正我是因为权限不足导致。你看1楼评论。我有说明解决方案

泛泛之交 2021-12-08 03:21:41

朋友解决了吗?怎么破的?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文