先给出配置文件内容
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>
<url>https://gitee.com/xshuai/taip.git</url>
<developers>
<developer>
<name>xiaoshuai</name>
<email>[email protected]</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 <[email protected]>" 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
针对这个错误不知道如果解决。烦请大神帮忙告知。