gpt4 book ai didi

java - 如何在maven中添加到原始父级的相对路径

转载 作者:行者123 更新时间:2023-12-02 04:41:46 25 4
gpt4 key购买 nike

我向我的父 pom 添加了一个来自开源社区的子模块。它有自己的 parent 。抛出以下内容:

[ERROR] Failed to read Maven project: 2 problems were encountered while building the effective model for com.offbytwo.jenkins:jenkins-client:0.2.1.302.1 [WARNING] 'parent.relativePath' points at com.verigreen:verigreen-root instead of org.sonatype.oss:oss-parent, please verify your project structure @ line 18, column 10 [FATAL] Non-resolvable parent POM: Failure to transfer org.sonatype.oss:oss-parent:pom:7 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.sonatype.oss:oss-parent:pom:7 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom and 'parent.relativePath' points at wrong local POM @ line 18, column 10 for project com.offbytwo.jenkins:jenkins-client:0.2.1.302.1 at C:\Verigreen\VG_test_branches\jenkins-client\pom.xml

我的父 pom 看起来像这样:

<artifactId>verigreen-root</artifactId>
<version>1.6.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>verigreen</name>
.
.
<modules>
<module>jenkins-client</module>
<module>vg-common</module>

jenkins-client pom 看起来像这样:

<name>Jenkins Client</name>
<url>http://github.com/RisingOak/jenkins-client</url>
<description>A Jenkins API client for Java</description>

<groupId>com.offbytwo.jenkins</groupId>
<artifactId>jenkins-client</artifactId>
<version>0.2.1.302.1</version>
<packaging>jar</packaging>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

如何指向父pom?

最佳答案

您的家长信息有误,请更改为:

<parent>
<groupId>com.verigreen</groupId>
<artifactId>verigreen-root</artifactId>
<version>1.6.1-SNAPSHOT</version>
</parent>

并将其添加到父 pom 上(如果它不存在):

<groupId>com.verigreen</groupId>

关于java - 如何在maven中添加到原始父级的相对路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30100942/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com