3

Maven プロジェクトに開発者として追加されたので、リリースする必要があります。ファイルに追加nexus-staging-maven-pluginしました。pom.xml

<plugin>
  <groupId>org.sonatype.plugins</groupId>
  <artifactId>nexus-staging-maven-plugin</artifactId>
  <version>1.6.3</version>
  <extensions>true</extensions>
  <configuration>
    <serverId>ossrh</serverId>
    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
    <autoReleaseAfterClose>true</autoReleaseAfterClose>
  </configuration>
</plugin>

また、私はに追加distributionManagementしましたpom.xml

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

資格情報を~/.m2/settings.xml

<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>divanov-oss.sonatype.org-account</username>
      <password>divanov-oss.sonatype.org-password</password>
    </server>
  </servers>
</settings>

また、資格情報として oss.sonatype.org で「アクセス ユーザー トークン」を作成して使用しようとしました。

今、リリースをmaven centralにデプロイするために実行しています。

mvn clean deploy

エラーになります:

[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.3:deploy
(injected-nexus-deploy) on project project: Failed to deploy artifacts:
Could not transfer artifact
project:jar:4.4.0-20141228.104011-1 from/to ossrh
(https://oss.sonatype.org/content/repositories/snapshots): Access denied to:
https://oss.sonatype.org/content/repositories/snapshots/project/project/4.4.0-SNAPSHOT/project-4.4.0-20141228.104011-1.jar,
ReasonPhrase: Forbidden. -> [Help 1]

また

[INFO] Performing remote staging...
[INFO] 
[INFO]  * Remote staging into staging profile ID "329a0bc2b7ce06"
[ERROR] Remote staging finished with a failure: 403 - Forbidden
[ERROR] 
[ERROR] Possible causes of 403 Forbidden:
[ERROR]  * you have no permissions to stage against profile with ID "329a0bc2b7ce06"? Get to Nexus admin...

リリースしようとしている Maven プロジェクト内のアクセス権を確認するにはどうすればよいですか?

4

2 に答える 2

-1

使用する必要がある認証情報は、Sonatype JIRA のものではなく、oss.sonatype.org のものであるべきです。そこに別途登録する必要があります。

[更新] 質問が変更されたため、この回答は関係ありません。よくある間違いなのでそのままにしておきます。

于 2014-12-28T11:07:47.097 に答える