1

I've had a prototype Ivy build working reasonably well. I just looked at it today and I'm seeing that it's finding an artifact on my intranet repo but not downloading it to the local cache or retrieving it in my local build, which causes the build to fail.

The build specifies several other dependencies, most of which are found on mavencentral, and one in another repo in the same local intranet repo that it's finding (but not downloading) the other artifact.

I've tried a few times to clear out the ivy cache and run this again, but it downloads all of the artifacts except for this particular one.

First, here is the relevant output from the build, with some minor pieces elided:

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)

The repositories "mavenCentralSnapshots" and "mavenCentralThirdparty" are actually on our local intranet repo (which is also confusedly called "maven central").

Notice that it says there are 9 modules, but only 8 were downloaded. The first artifact in the list, "poc-domain-model" is the one that is not being downloaded, but I don't see why.

Here is my "ivysettings.xml" file:

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

And here is my "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"/>
    <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>

And finally, here's the excerpt from my build.xml that calls Ivy:

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

Is it obvious what my problem is, or is there something I can do to get more information?

Update:

Here is an elided version of my "com.att.ecom.poc-coherence_poc-default.xml" file:

<?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>

Update:

I finally noticed that the download fails because the exact fully-qualified path doesn't exist on the intranet repo. It's looking for a file with "SNAPSHOT" in the name, but the files in the directory only have timestamps, not "SNAPSHOT".

I noticed the following discussion, which seems relevant: enter link description here .

As a result of this, I modified by "ivysettings.xml" to the following slightly elided version:

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

Unfortunately, this made no difference, it still just tries to find the "SNAPSHOT" file, which doesn't exist.

Update:

Actually, I realized another extremely important detail in that error where it fails to find the SNAPSHOT artifact on our MavenCentral. Here's the actual excerpt from the output:

:: 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

What I should have noticed from this is that it isn't even trying to get the artifact from my snapshot repository at all. It's failing to find it on the public mavencentral, not mine. That tells me there's something wrong with my "ivysettings.xml", but I don't know what it would be.

Community
  • 1
  • 1
David M. Karr
  • 14,317
  • 20
  • 94
  • 199
  • which dependency is not being retrieved? – Eyad Ebrahim Feb 08 '14 at 08:51
  • "Notice that it says there are 9 modules, but only 8 were downloaded. The first artifact in the list, "poc-domain-model" is the one that is not being downloaded, but I don't see why." – David M. Karr Feb 08 '14 at 17:24
  • Since the resolution is not failing in your case, it means that there is something in the snapshot repository. Could you validate that it has the same structure as the the central one, since they are both maven. Also could you check in your cache, if the folder com.att.ecom.poc exists? Also could you please provide from the cache the file resolved-com.att.ecom.poc*.xml. Probably check also the com.att.ecom.poc-coherence_poc-default.xml file as it has the report of what exactly happens. My idea: ivy.xml was found, then either configuration or artifact was missing because of bad deployment – Eyad Ebrahim Feb 08 '14 at 18:41
  • I don't know how to validate that "it has the same structure as the central one", and I'm not sure what you mean by "it" here. The artifact that is resolving, but not retrieving, isn't available in "central" (being the true MavenCentral), it's only available in the snapshots repo on our "MavenCentral" (which is a Nexus Pro instance in our intranet). I'll address the other questions in separate comments. – David M. Karr Feb 10 '14 at 16:53
  • The folder "~/.ivy2/cache/com.att.ecom.poc" exists. It contains a folder named "poc-domain-model", which has three files: ivy-0.0.1-SNAPSHOT.xml, ivydata-0.0.1-SNAPSHOT.properties, ivy-0.0.1-SNAPSHOT.xml.original. In my local cache, I have "resolved-com.att.ecom.poc-coherence_poc-working@.properties" and "resolved-com.att.ecom.poc-coherence_poc-working@.xml". Those are the only "resolved" files in my cache. I'll update the main posting with an elided version of "com.att.ecom.poc-coherence_poc-default.xml". – David M. Karr Feb 10 '14 at 18:09
  • Comments to the next answer are relevant. It's failing to download the artifact because the file with that exact file name doesn't exist on the repo, only the snapshots with timestamps on them. I don't know what I should expect in the repo, and what I should be specifying in the dependency. – David M. Karr Feb 10 '14 at 19:09

1 Answers1

0

Please check the comment above as well: however in addition: change your ivy.xml to the following:

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

And then enable check the "ivy console" with debug level. (Ivy console in the console view of Eclipse) if possible.

Eyad Ebrahim
  • 971
  • 1
  • 8
  • 21
  • Not too surprisingly, when I selected the "Open Ivy console on startup" checkbox and clicked OK, it gave me this: "Some projects fail to be resolved Impossible to resolve dependencies of com.att.ecom.poc#coherence_poc;working@ download failed: com.att.ecom.poc#poc-domain-model;0.0.1-SNAPSHOT!poc-domain-model.jar(bundle)". More info in next comment. – David M. Karr Feb 10 '14 at 18:36
  • When I looked in detail at the ivy debug, I saw this: "http://repo1.maven.org/maven2/com/att/ecom/poc/poc-domain-model/0.0.1-SNAPSHOT/poc-domain-model-0.0.1-SNAPSHOT.jar" in the "tried" list when it reported that it failed to download this artifact. Not too surprisingly, this file does not exist. What does exist in that folder are many files with names like this: "poc-domain-model-0.0.1-20131206.234206-76.jar". I then inspected the build output that produces this artifact, and it clearly only uploads files with that last pattern with the timestamp, not the "simpler" pattern without it. – David M. Karr Feb 10 '14 at 19:08
  • If you are uploading the artifact with specific pattern, why are you expecting it to exists in the central maven (according to your comment above). You produce it with timestamp then you have to import it accordingly, or just produce as SNAPSHOT hardcoded and life can be easy. – Eyad Ebrahim Feb 11 '14 at 17:16
  • I'm just using "mvn deploy" to deploy "poc-domain-model-0.0.1-SNAPSHOT.jar" to the snapshot repo. Maven (or Nexus) internally stores it with a timestamp. This is standard behavior. I would be perfectly happy to import it with Ivy as it is stored in the repo, but I can't figure out how to do that. – David M. Karr Feb 11 '14 at 21:22
  • http://ant.apache.org/ivy/history/latest-milestone/tutorial/dependence.html: keyword: latest.integration or latest.release. never tried it, but it exists. good luck. – Eyad Ebrahim Feb 12 '14 at 13:26
  • Isn't that going to get the newest copy on any version? That's not right. I need the newest copy of a SPECIFIC version. In any case, that seems like it's not relevant to my problem. – David M. Karr Feb 13 '14 at 16:43