【发布时间】:2021-08-18 21:47:07
【问题描述】:
我已经成功地将一个 java 包部署到 Github 包,我尝试将它成功作为依赖项使用:
<dependency>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
但我无法像这样将它解析(获取)为 maven 插件:
<build>
<plugins>
<plugin>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
</plugin>
...
我收到此错误:
Plugin com.example:demo:1.0.0-SNAPSHOT or one of its dependencies could not be resolved:
Could not find artifact com.example:demo:1.0.0-SNAPSHOT -> [Help 1]
.m2/settings.xlm 也已准备就绪并且工作正常,因为我通过将包作为依赖项而不是插件获取包来测试它,它包含:
<server>
<id>github</id>
<username>USER</username>
<password>PERSONAL_TOKEN_SCOPE_REPO_W_R_PACKAGES</password>
</server>
<profile>
<id>github</id>
<repositories>
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/OWNER/REPO-NAME</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<updatePolicy>always</updatePolicy>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
有什么想法吗?提前致谢
【问题讨论】:
标签: java maven github github-actions github-package-registry