我正在尝试GitHub packages beta
,我有一个要发布的 Maven 项目。在POM.xml
我确实添加了下面tag
。
test-package
是我的repository
名字。
<repository>
<id>github</id>
<name>GitHub amarkum Apache Maven Packages</name>
<url>https://maven.pkg.github.com/amarkum/test-package</url>
</repository>
</distributionManagement>
我已经在我的~/.m2/setting.xml
.
当我运行mvn deploy
命令时,它无法发布包。我也尝试手动提供令牌
mvn deploy -Dregistry=https://maven.pkg.github.com/amarkum -Dtoken=<MY_TOKEN_GENERATED>
.
read:packages
我生成的令牌除了和write:packages
范围之外,还具有所有可以确定的特权
错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project test-package: Failed to retrieve remote metadata com.codefolx.test:test-package:1.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.codefolx.test:test-package:1.0-SNAPSHOT/maven-metadata.xml from/to github (https://maven.pkg.github.com/amarkum/test-package): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
我哪里错了?