- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已按照此 document 中给出的步骤进行操作在 GitHub 包注册表上部署包,我能够成功部署包。可以看出here .
现在我正在尝试将其作为依赖项安装到另一个项目中。如上面的链接所示,我在我的 pom 文件中添加了这个依赖项。
<dependency>
<groupId>com.github.ashishchopra/github_package_registry</groupId>
<artifactId>group-upload.artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
这显然会引发此错误:
[ERROR] 'dependencies.dependency.groupId' for com.github.ashishchopra/github_package_registry:group-upload.artifct-upload:jar with value 'com.github.ashishchopra/github_package_registry' does not match a valid id pattern.
现在我删除了 groupId 中 /
之前的部分,并像这样建立依赖关系:
<dependency>
<groupId>github_package_registry</groupId>
<artifactId>group-upload.artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
现在我收到这个错误:
Downloading: https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/group-upload.artifct-upload-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.275 s
[INFO] Finished at: 2019-10-10T19:47:42+05:30
[INFO] Final Memory: 18M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project artifct-download: Could not resolve dependencies
for project group-download:artifct-download:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at github_package_registry:group-upload.artifct-upload:jar:0.0.1: Failed to read artifact descriptor for github_package_registry:group-upload.artifct-upload:jar:0.0.1: Could not transfer artifact github_package_registry:group-upload.artifct-upload:pom:0.0.1 from/to github (https://maven.pkg.github.com/ashishchopra): Failed to transfer file: https://maven.pkg.github.com/ashishchopra/github_package_registry/group-upload.artifct-upload/0.0.1/group-upload.artifct-upload-0.0.1.pom. Return code is: 400 , ReasonPhrase:Bad Request. -> [Help 1]
我还尝试从依赖项中的 artifactId 中删除 groupId.
部分,并使其像这样:
<dependency>
<groupId>github_package_registry</groupId>
<artifactId>artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
这次我遇到了这个错误:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.417 s
[INFO] Finished at: 2019-10-10T19:52:08+05:30
[INFO] Final Memory: 18M/67M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project artifct-download: Could not resolve dependencies for project group-download:artifct-download:jar:0.0.1-SNAPSHOT: Could not find artifact github_package_registry:artifct-upload:jar:0.0.1 in central (https://repo1.maven.org/maven2) ->
[Help 1]
所以没有组合,它似乎有效。
我的 ~/.m2/settings.yml 文件的内容:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub ashishchopra Apache Maven Packages</name>
<url>https://maven.pkg.github.com/ashishchopra</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>ashishchopra</username>
<password>XXXX</password>
</server>
</servers>
这些是他们文档中的直接步骤,没什么特别的,但我还是无法让它工作。
实际的 pom 和 jar 文件存在于此链接中
最佳答案
根据 documentation您指出,maven 存储库的 URL 应包含您的 GitHub 存储库的名称,即 github_package_registry
。这就是您在 settings.xml 中需要的内容:
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/ashishchopra/github_package_registry</url>
</repository>
</repositories>
在你的 pom.xml 中,只需使用你的 GitHub Packages page 中描述的依赖项:
<dependency>
<groupId>group-upload</groupId>
<artifactId>artifct-upload</artifactId>
<version>0.0.1</version>
</dependency>
关于maven - 来自 GitHub 包注册表的 mvn 安装包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58325279/
我正在为我的项目使用 Maven。如果我的项目不使用某些本地资源,这不是问题。 以便我遵循本指南 https://stackoverflow.com/a/61576687/6720896 将我的本地
今天我尝试通过 Maven 使用 site 命令生成报告,在编译阶段遇到了问题。 错误: ParseException in /Users/rajesh/Documents/workspace/mob
这个问题已经有答案了: Mvn install or Mvn package (8 个回答) 已关闭 6 年前。 我是一名新开发人员,一生中从未使用过 eclipse 或 java,我正在尝试做一些事
我知道mvn:package可以用来生成JAR或WAR,mvn:assemble有什么区别吗? 最佳答案 他们是完全不同的。 “package”是一个简单的命令,用于简单/单个项目,您只需创建一个 j
我正在使用 Maven 运行单个测试。 以这两种方式运行它的区别是: mvn -Dtest=DatabaseTest test mvn -Dtest=DatabaseTest surefire:tes
我已经从 svn checkout 了一个项目。我正在尝试使用 Maven 构建项目。 使用 mvn 编译可以很好地构建。 当我尝试命令 mvn package 时,出现以下错误。 [INFO] --
当我使用 Maven 故障安全插件运行集成测试时遇到问题。我有两个类,一个是 TestUnitTest.java,另一个是 TestIntegrationIT.java。在pom.xml中,我配置如下
我有一个测试用例: import org.graph.*; import org.junit.*; public class TestCase_1 { @Test public voi
大家好,我有这两个问题 mvn clean 我收到此警告消息 Some problems were encountered while building the effective model for
Maven的mvn install和mvn verify命令有什么区别? 关键字clean如何修改这些命令? 最佳答案 mvn verify - 如前所述 - 执行 maven 在项目中找到的任何集成
我正在关注 Scala, Eclipse and Maven Integration tutorial . 这真的很有用。 但是有一件事情让我觉得很烦: 我总是需要从 Eclipse 运行两个命令作为
虽然我知道 mvn install -U 用于 update-snapshots 并且它更新了从构建日志中看到的远程存储库中的所有内容,但我无法了解它会强制更新哪一部分。因为据我了解,即使是 mvn
我已经阅读了@ codehaus exec-maven-plugin usage 的文档.我知道 exec:java 允许用户在他们声明的同一个 VM 中执行 java 程序。我是 Maven 的新手
我正在使用树脂服务器开发一个 Java 项目(其中 maven 是构建工具)。我找到了一些不错的 plugins对于 Tomcat,如果我发出 'mvn compile'然后编译文件转到/webapp
我有一个打包为 war 文件(包括几个 jar 文件)的 Web 应用程序。我注意到当我运行 mvn install 时——唯一被编译的项目是那些已经改变的——然后它替换了 war 文件中的这些 ja
这个问题在这里已经有了答案: IDEA JetBrains IntelliJ - Compile error on 'make' but fine when compiled using Maven
mvn clean install和mvn install有什么区别? 最佳答案 clean 在 Maven 中是它自己的构建生命周期阶段(可以被认为是一个 Action 或任务)。 mvn clea
我的团队使用内部团队 Maven 存储库,该存储库是使用 Apache 从开发服务器共享的。我们还在同一台机器上运行 Continuum CI 服务器。 Continuum 中的 Maven 构建以“
我正在尝试执行“mvn install”以从 Dockerfile 创建 war 文件。波纹管是Dockerfile FROM scratch FROM ubuntu:16.04 RUN mkdir
mvn 验证失败并抛出依赖错误。 Dependency convergence error for com.company.concepts:patients:2.4.14-SNAPSHOT path
我是一名优秀的程序员,十分优秀!