2016-08-23 78 views
1

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

<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它showi纳克轨迹如下

在它表明这是从本地关系库下载

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 

谁能帮我解决了这个错误.. 有什么事情关系到代理设置? ,

,因为它是不会到远程存储库链接..

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

<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> 
+0

正确配置你的连接从jenkins-ci回购下载,而不是手动添加到你的pom文件中... – khmarbaise

回答

1

这是类似于此question

如果你的父POM是从远程仓库中取出,那么你可以修改你的父标签作为

<parent> 
     <groupId>org.jenkins-ci.plugins</groupId> 
     <artifactId>plugin</artifactId> 
     <version>1.567</version> 
     <relativePath></relativePath> 
    </parent> 

添加一个空relativepath将解决父POM从存储库。如果不指定relativePath,则默认为../pom.xml。

从DOC,

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

这里请参阅doc

+1

我已经尝试添加。但是,它仍然是一样的。 我已经把Settings.xml放在上面。你能否建议如果上面的配置是迫使它从本地连接库而不是远程库下载 – Harsha

相关问题