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

小帅帅丶 发布于 2018/04/13 11:06
阅读 2K+
收藏 1

@ 阿信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:\workspace\taip\target\taip-1.0.0-javadoc.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ taip ---
[INFO] Installing E:\workspace\taip\target\taip-1.0.0.jar to E:\repository\cn\xsshome\taip\1.0.0\tai
p-1.0.0.jar
[INFO] Installing E:\workspace\taip\pom.xml to E:\repository\cn\xsshome\taip\1.0.0\taip-1.0.0.pom
[INFO] Installing E:\workspace\taip\target\taip-1.0.0-sources.jar to E:\repository\cn\xsshome\taip\1
.0.0\taip-1.0.0-sources.jar
[INFO] Installing E:\workspace\taip\target\taip-1.0.0-javadoc.jar to E:\repository\cn\xsshome\taip\1
.0.0\taip-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🏺1.0
.0 from/to taip (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Access denied to: h
ttps://oss.sonatype.org/service/local/staging/deploy/maven2/cn/xsshome/taip/1.0.0/taip-1.0.0.jar, Re
asonPhrase: Forbidden. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following arti
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

针对这个错误不知道如果解决。烦请大神帮忙告知。

加载中
0
小帅帅丶
小帅帅丶

 

有可能是权限问题导致。咨询issue人员。也是一种解决方案。当然这个问题百度是直接找不到https://stackoverflow.com网站相关问题解答。在谷歌的搜索下。让我看到了希望。并且解决了问题

用我拙劣的抠脚英语咨询错误。然后回复我调整了权限后。deploy成功

0
边鹏_尛爺鑫
边鹏_尛爺鑫

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

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

好的,谢谢

0
边鹏_尛爺鑫
边鹏_尛爺鑫

我密码设置那些肯定是对的,但是我之前没加maven-javadoc-plugin,发上去后不能发版。我就删除了,重新提交,结果就有问题了。怎么与官方沟通?创建一个Issue  类型是Problem吗?

0
边鹏_尛爺鑫
边鹏_尛爺鑫

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

 

小帅帅丶
小帅帅丶
直接评论。反正应该是有时差的
0
边鹏_尛爺鑫
边鹏_尛爺鑫

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

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