为什么Ivy不从我们的Intranet repo下载工件?

时间:2014-02-07 17:49:25

标签: ant ivy

我有一个原型常春藤构建工作相当不错。我今天只看了它,我发现它在我的Intranet repo上找到了一个工件,但没有将它下载到本地缓存或在我的本地构建中检索它,这导致构建失败。 / p>

构建指定了其他几个依赖项,其中大多数都是在mavencentral上找到的,另一个是在同一个本地Intranet repo中的另一个repo中,它找到(但没有下载)另一个工件。

我已经尝试了几次清除常春藤缓存并再次运行它,但它会下载所有工件,除了这个特殊的工件。

首先,这是构建的相关输出,其中一些小部分被省略:

install-dependencies:
:: Apache Ivy 2.3.0 - 20130110142753 :: http://ant.apache.org/ivy/ ::
:: loading settings :: file = <pathtoivysettingsxmlfile>
:: resolving dependencies :: com.att.ecom.poc#coherence_poc;working@<hostname> [not transitive]
    confs: [default]
    found com.att.ecom.poc#poc-domain-model;0.0.1-SNAPSHOT in mavenCentralSnapshots
    found org.apache.commons#commons-lang3;3.1 in central
    found org.springframework#spring-aop;4.0.0.RELEASE in central
    found org.springframework#spring-beans;4.0.0.RELEASE in central
    found org.springframework#spring-context;4.0.0.RELEASE in central
    found org.springframework#spring-core;4.0.0.RELEASE in central
    found org.springframework#spring-expression;4.0.0.RELEASE in central
    found org.springframework#spring-web;4.0.0.RELEASE in central
    found com.oracle.coherence#coherence;12.1.2-0-0 in mavenCentralThirdparty
:: resolution report :: resolve 351ms :: artifacts dl 8ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   9   |   0   |   0   |   0   ||   8   |   0   |
    ---------------------------------------------------------------------
:: retrieving :: com.att.ecom.poc#coherence_poc
    confs: [default]
    0 artifacts copied, 8 already retrieved (0kB/5ms)

存储库&#34; mavenCentralSnapshots&#34;和&#34; mavenCentralThirdparty&#34;实际上是在我们的本地内部网回购(也被称为#34; maven central&#34;)。

请注意,它说有9个模块,但只下载了8个。列表中的第一个工件,&#34; poc-domain-model&#34;是没有下载的那个,但我不明白为什么。

这是我的&#34; ivysettings.xml&#34;文件:

<ivysettings>
    <settings defaultResolver="default"/>
    <property name="m2-pattern" value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]" override="false" />
    <resolvers>
        <chain name="default">
            <filesystem name="local-maven2" m2compatible="true" >
                <artifact pattern="${m2-pattern}"/>
                <ivy pattern="${m2-pattern}"/>
            </filesystem>
            <ibiblio name="mavenCentralSnapshots" m2compatible="true"
             root="http://<hostandport>/nexus/content/repositories/cditspoc-snapshots"/>
            <ibiblio name="mavenCentralThirdparty" m2compatible="true"
             root="http://<hostandport>/nexus/content/repositories/cditspoc-3rd-party"/>
            <ibiblio name="central" m2compatible="true"/>
        </chain>
    </resolvers>
</ivysettings>

这是我的&#34; ivy.xml&#34;:

<ivy-module version="2.0">
  <info organisation="com.att.ecom.poc" module="coherence_poc"/>
  <dependencies>
    <dependency org="com.att.ecom.poc" name="poc-domain-model" rev="0.0.1-SNAPSHOT"/>
    <dependency org="org.apache.commons" name="commons-lang3" rev="3.1"/>
    <dependency org="org.springframework" name="spring-aop" rev="4.0.0.RELEASE"/>
    <dependency org="org.springframework" name="spring-beans" rev="4.0.0.RELEASE"/>
    <dependency org="org.springframework" name="spring-context" rev="4.0.0.RELEASE"/>
    <dependency org="org.springframework" name="spring-core" rev="4.0.0.RELEASE"/>
    <dependency org="org.springframework" name="spring-expression" rev="4.0.0.RELEASE"/>
    <dependency org="org.springframework" name="spring-web" rev="4.0.0.RELEASE"/>
    <dependency org="com.oracle.coherence" name="coherence" rev="12.1.2-0-0"/>
  </dependencies>
</ivy-module>

最后,这里是我的build.xml的摘录,它叫做Ivy:

<target name="install-dependencies">
  <ivy:resolve transitive="false" type="jar"/>
  <ivy:retrieve conf="*" type="jar" pattern="${basedir}/lib/[artifact]-[type]-[revision].[ext]"/>
</target>

我的问题是显而易见的,或者我能做些什么来获取更多信息?

更新

以下是我的&#34; com.att.ecom.poc-coherence_poc-default.xml&#34;的删除版本。文件:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ivy-report.xsl"?>
<ivy-report version="1.0">
    <info
        organisation="com.att.ecom.poc"
        module="coherence_poc"
        revision="working@<hostname>"
        conf="default"
        confs="default"
        date="20140210084517"/>
    <dependencies>
        <module organisation="com.oracle.coherence" name="coherence">
            <revision name="12.1.2-0-0" status="release" pubdate="20131118143843" resolver="mavenCentralThirdparty" artresolver="mavenCentralThirdparty" homepage="" downloaded="false" searched="false" default="false" conf="system, default, optional, compile, *, provided, runtime, javadoc, sources, master" position="8">
                <metadata-artifact status="no" details="" size="2283" time="0" location="<homedir>\.ivy2\cache\com.oracle.coherence\coherence\ivy-12.1.2-0-0.xml" searched="false" origin-is-local="false" origin-location="<intranetmavenrepo>/nexus/content/repositories/cditspoc-3rd-party/com/oracle/coherence/coherence/12.1.2-0-0/coherence-12.1.2-0-0.pom"/>
                <caller organisation="com.att.ecom.poc" name="coherence_poc" conf="default" rev="12.1.2-0-0" rev-constraint-default="12.1.2-0-0" rev-constraint-dynamic="12.1.2-0-0" callerrev="working@<hostname>"/>
                <artifacts>
                    <artifact name="coherence" type="jar" ext="jar" status="no" details="" size="7027491" time="0" location="<homedir>\.ivy2\cache\com.oracle.coherence\coherence\jars\coherence-12.1.2-0-0.jar">
                        <origin-location is-local="false" location="<intranetmavenrepo>/nexus/content/repositories/cditspoc-3rd-party/com/oracle/coherence/coherence/12.1.2-0-0/coherence-12.1.2-0-0.jar"/>
                    </artifact>
                </artifacts>
            </revision>
        </module>
        <module organisation="org.springframework" name="spring-web">
            <revision name="4.0.0.RELEASE" status="release" pubdate="20131211234952" resolver="central" artresolver="central" homepage="https://github.com/SpringSource/spring-framework" downloaded="false" searched="false" default="false" conf="system, default, optional, compile, *, provided, runtime, javadoc, sources, master" position="7">
                <license name="The Apache Software License, Version 2.0" url="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
                <metadata-artifact status="no" details="" size="5998" time="0" location="<homedir>\.ivy2\cache\org.springframework\spring-web\ivy-4.0.0.RELEASE.xml" searched="false" origin-is-local="false" origin-location="http://repo1.maven.org/maven2/org/springframework/spring-web/4.0.0.RELEASE/spring-web-4.0.0.RELEASE.pom"/>
                <caller organisation="com.att.ecom.poc" name="coherence_poc" conf="default" rev="4.0.0.RELEASE" rev-constraint-default="4.0.0.RELEASE" rev-constraint-dynamic="4.0.0.RELEASE" callerrev="working@<hostname>"/>
                <artifacts>
                    <artifact name="spring-web" type="jar" ext="jar" status="no" details="" size="661567" time="0" location="<homedir>\.ivy2\cache\org.springframework\spring-web\jars\spring-web-4.0.0.RELEASE.jar">
                        <origin-location is-local="false" location="http://repo1.maven.org/maven2/org/springframework/spring-web/4.0.0.RELEASE/spring-web-4.0.0.RELEASE.jar"/>
                    </artifact>
                </artifacts>
            </revision>
        </module>
... several other spring and commons artifacts resolved from central
        <module organisation="com.att.ecom.poc" name="poc-domain-model">
            <revision name="0.0.1-SNAPSHOT" status="integration" pubdate="20140207093019" resolver="mavenCentralSnapshots" artresolver="mavenCentralSnapshots" homepage="" downloaded="false" searched="false" default="false" conf="system, default, optional, compile, *, provided, runtime, javadoc, sources, master" position="0">
                <metadata-artifact status="no" details="" size="3337" time="0" location="<homedir>\.ivy2\cache\com.att.ecom.poc\poc-domain-model\ivy-0.0.1-SNAPSHOT.xml" searched="false" origin-is-local="false" origin-location="<intranetmavenrepo>/nexus/content/repositories/cditspoc-snapshots/com/att/ecom/poc/poc-domain-model/0.0.1-SNAPSHOT/poc-domain-model-0.0.1-20140207.173018-85.pom"/>
                <caller organisation="com.att.ecom.poc" name="coherence_poc" conf="default" rev="0.0.1-SNAPSHOT" rev-constraint-default="0.0.1-SNAPSHOT" rev-constraint-dynamic="0.0.1-SNAPSHOT" callerrev="working@<hostname>"/>
                <artifacts>
                </artifacts>
            </revision>
        </module>
    </dependencies>
</ivy-report>

更新

我终于注意到下载失败了,因为Intranet repo上没有完全合格的路径。它正在寻找带有&#34; SNAPSHOT&#34;的文件。在名称中,但目录中的文件只有时间戳,而不是&#34; SNAPSHOT&#34;。

我注意到以下讨论似乎相关:enter link description here

因此,我修改了&#34; ivysettings.xml&#34;以下略微省略的版本:

<ivysettings>
<settings defaultResolver="default"/>
<property name="m2-pattern" value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]" override="false" />
<resolvers>
    <chain name="default">
    <filesystem name="local-maven2" m2compatible="true" >
        <artifact pattern="${m2-pattern}"/>
        <ivy pattern="${m2-pattern}"/>
    </filesystem>
    <ibiblio name="mavenCentralSnapshots" m2compatible="true"
         root="http://<hostandport>/nexus/content/repositories/cditspoc-snapshots"
         pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
    <ibiblio name="mavenCentralThirdparty" m2compatible="true"
         root="http://<hostandport>/nexus/content/repositories/cditspoc-3rd-party"/>
    <ibiblio name="central" m2compatible="true"/>
    </chain>
</resolvers>
</ivysettings>

不幸的是,这没有任何区别,它仍然只是试图找到&#34; SNAPSHOT&#34;文件,它不存在。

更新

实际上,我在该错误中意识到另一个非常重要的细节,即它在我们的MavenCentral上找不到SNAPSHOT工件。这是输出的实际摘录:

:: problems summary ::
:::: WARNINGS
        [FAILED     ] com.att.ecom.poc#poc-domain-model;0.0.1-SNAPSHOT!poc-domain-model.jar(bundle):  (0ms)

    ==== shared: tried

      C:\Users\dk068x\.ivy2\shared\com.att.ecom.poc\poc-domain-model\0.0.1-SNAPSHOT\bundles\poc-domain-model.jar

    ==== public: tried

      http://repo1.maven.org/maven2/com/att/ecom/poc/poc-domain-model/0.0.1-SNAPSHOT/poc-domain-model-0.0.1-SNAPSHOT.jar

我应该注意到的是,它甚至都没有尝试从我的快照存储库中获取工件。它没有在公共场合找到它,而不是我的。这告诉我,我的&#34; ivysettings.xml&#34;有问题,但我不知道它会是什么。

1 个答案:

答案 0 :(得分:0)

请检查上面的评论: 但另外:将您的ivy.xml更改为以下内容:

<ivy-module version="2.0">
    <info organisation="com.att.ecom.poc" module="coherence_poc"/>
    <dependencies>
    <dependency org="com.att.ecom.poc" name="poc-domain-model" rev="0.0.1-SNAPSHOT"/>
    </dependencies>
</ivy-module>

然后启用检查调试级别的“常春藤控制台”。 (如果可能的话,在Eclipse的控制台视图中使用常春藤控制台。