2014-09-02 133 views
0

我无法使用ivy-2.3.0和nexus/maven 2回购解决SNAPSHOT依赖关系。常春藤(2.3.0或2.4)不解决SNAPSHOT与分类器的maven依赖关系

我已经尝试了几件事情,但还是失败了,

部分已定:看到我在评论区发表评论。

我得到的最新输出是maven:分类器不是与元素相关的 。为此,我需要填写名称空间 映射,不知道这应该如何看待分类器部分的maven和ivy 。

我的联系是使用时间戳。

我的,项目文件

<project 
name="test" 
xmlns:ivy="antlib:org.apache.ivy.ant" 
> 

<ivy:settings file="ivysettings.xml" /> 

<ivy:retrieve pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" /> 

..... 

我ivysettings文件:

<?xml version="1.0" encoding="UTF-8"?> 
<ivysettings> 

    <!-- what should I put here for maven and ivy to use classifier? --> 
    <namespace name="test"> 
     <rule> 
     <fromsystem> 
      <src org="systemorg"/> 
      <dest org="A"/> 
     </fromsystem> 
     <tosystem> 
      <src org="A"/> 
      <dest org="systemorg"/> 
     </tosystem> 
     </rule> 
    </namespace> 


    <credentials host="nexus" 
         realm="Sonatype Nexus Repository Manager" 
         username="xyz" passwd="xyz"/> 

    <property name="libs_snapshot" 
        value="http://nexus.host.com/nexus/content/repositories/libs_snapshot"/> 

    <property 
     name="version_pattern" 
     value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" 
    /> 

    <settings defaultResolver="repos" /> 
    <resolvers> 
     <chain name="repos"> 


      <ibiblio name="central" m2compatible="true"/> 
      <ibiblio 
       name="libs_snapshot" 
       m2compatible="true" 
       pattern="${version_pattern}" 
       root="${libs_snapshot}" 
      /> 


     </chain> 
    </resolvers> 

</ivysettings> 

我ivy.xml文件:

<ivy-module version='2.0' xmlns:m="http://ant.apache.org/ivy/maven"> 
    <info 
     organisation="com.xyz" 
     module="chained-resolvers" 
    /> 

    <dependencies> 
     <dependency 
      org="com.xyz" 
      name="cache_store" 
      rev="1.1-SNAPSHOT" 
      changing="true" 
     > 
     <artifact name="cache_store" 
       m:classifier="mobile" 
       type="jar" ext="jar"/> 
     </dependency> 
    </dependencies> 

</ivy-module> 
+0

我设法解决常春藤抱怨的部分。 maven:分类器没有与元素相关联。 将xmlns:m =“http://ant.apache.org/ivy/maven” 添加到常青藤模块。 line so: Wayne 2014-09-02 15:02:56

+0

问题并不清楚。以下是如何使用Maven分类器检索快照工件的示例:http://stackoverflow.com/questions/7804253/how-to-dowload-multiple-maven-dependencies-in-ivy-with-different-classifiers/7815627#7815627 – 2014-09-02 19:01:03

回答

0

虽然我得到了错误的消息说,常青藤无法解析依赖关系, 实际上有http 401错误,说我是未经授权的。

通过使用参数“-debug”运行ant任务显示真正的原因。

HTTP response status: 401 url= 
CLIENT ERROR: Unauthorized url= 

我不得不添加的安全证书,但似乎有与 进入我有一个问题:

这一个没有工作,解决了我的问题,我有:

<credentials 
    host="server" 
    realm="Sonatype Nexus Repository Manager" 
    username="username" passwd="password" 
/> 

这一个工作:

<credentials 
    host="server.xyz.com" 
    realm="Sonatype Nexus Repository Manager" 
    username="username" passwd="password" 
/> 
相关问题