首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >发出远程存储库中存在的依赖项。

发出远程存储库中存在的依赖项。
EN

Stack Overflow用户
提问于 2016-08-23 15:11:27
回答 1查看 653关注 0票数 1

在项目的pom.xml中,它具有要从远程存储库下载的依赖项。

代码语言:javascript
复制
<parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>1.567</version>
</parent>

<repositories>
    <repository>
        <id>repo.jenkins-ci.org</id>
        <url>http://repo.jenkins-ci.org/public/</url>
    </repository>
</repositories>

我理解的是Maven

  1. 如果找不到本地存储库中的搜索
  2. 如果找不到本地企业关系存储库中的搜索
  3. 应该从远程存储库下载

当我执行命令mvn test时,它会显示如下所示的跟踪

在错误中,它显示它是从本地连接库下载的。

代码语言:javascript
复制
Could not find artifact org.jenkins-ci.plugins:plugin:pom:1.567 in nexus (http://localnexus/nexus/content/groups/group/) and 'parent.relativePath' points at no local POM 

有人能帮我解决这个问题吗。这与代理设置有关吗?

因为它不去远程存储库链接..

代码语言:javascript
复制
 D:\Hygieia-master\hygieia-jenkins-plugin>mvn test

[INFO] Scanning for projects…

Downloading: http://localnexus/nexus/content/groups/group/org/jenkins-ci/plugins/plugin/1.567/plugin-1.567.pom

Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/plugin/1.567/plugin-1.567.pom

[ERROR] [ERROR] Some problems were encountered while processing the POMs:

[FATAL] Non-resolvable parent POM for org.jenkins-ci.plugins:hygieia-publisher:1.4-SNAPSHOT: Could not find artifact org.jenkins-ci.plugins:plugin:pom:1.567 in nexus (http://localnexus/nexus/content/groups/group/) and 'parent.relativePath' points at no local POM @ line 15, column 13
 @

[ERROR] The build could not read 1 project -> [Help 1]

[ERROR]
[ERROR]   The project org.jenkins-ci.plugins:hygieia-publisher:1.4-SNAPSHOT (D:\Hygieia-master\hygieia-jenkins-plugin\pom.xml) has 1 error

[ERROR]     Non-resolvable parent POM for org.jenkins-ci.plugins:hygieia-publisher:1.4-SNAPSHOT: Could not find artifact org.jenkins-ci.plugins:plugin:pom:1.567 in nexus (http://localnexus/nexus/content/groups/group/) and 'parent.relativePath' points at no local POM @ line 15, column 13 -> [Help 2]
[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

下面是我的Settings.xml

代码语言:javascript
复制
  <settings>
    <servers>
        <server>
            <id>nexus</id>
            <username>user</username>
            <password>pwd</password>
            <configuration>
                <httpConfiguration>
                    <all>
                        <params>
                            <param>
                                <name>http.authentication.preemptive</name>
                                <value>%b,true</value>
                            </param>
                        </params>
                    </all>
                </httpConfiguration>
                <httpHeaders>
                    <property>
                        <name>username</name>
                        <value>user</value>
                    </property>
                </httpHeaders>
            </configuration>
        </server>
    </servers>

  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>central</mirrorOf>
      <url>http://localnexus/nexus/content/groups/group/</url>
    </mirror>   
  </mirrors>
  <profiles>
    <profile>   
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>

      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>

      </pluginRepositories>
      <properties>
              <archetypeCatalog>http://localnexus/nexus/content/groups/PUBLIC_REPO/</archetypeCatalog>
      </properties>

    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>




</settings>
EN

回答 1

Stack Overflow用户

发布于 2016-08-23 18:39:57

这类似于这个问题

如果从远程存储库获取父pom,则可以将父标记修改为

代码语言:javascript
复制
    <parent>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <version>1.567</version>
        <relativePath></relativePath>
    </parent>

添加一个空的相对论性路径将解析存储库中的父POM。如果未指定relativePath,则默认为./pu.xml。

从医生那里,

签出中父pom.xml文件的相对路径。如果未指定,则默认为./头. not。Maven首先在文件系统的这个位置查找父POM,然后查找本地存储库,最后在远程回购中查找。relativePath允许您选择不同的位置,例如,当您的结构是扁平的,或者在没有中间父POM的情况下更深的位置。但是,组ID、工件ID和版本仍然是必需的,并且必须与给定位置的文件匹配,否则它将恢复到POM的存储库。此特性仅用于增强该项目的本地签出中的开发。将值设置为空字符串,以防要禁用该特性并始终解析存储库中的父POM。默认值是:./头.。

有关文档,请参阅这里。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39104875

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档