Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1028

Snapshot issues when using ibiblio resolver when m2compatible is false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1.0-RC2
    • Core
    • None

    Description

      I changed the java.net resolver to use the maven2 of download.java.net and added m2compatible and usepoms=true. Now it does not fail with NPE.

      --------------------
      I think you've found a bug in Ivy.
      It seems to be caused by your "java.net" resolver. Could you try what happens if you add m2compatible="true" and usepoms="true" to this resolver?

      <ibiblio name="java.net" root="${java.net.repo}" m2compatible="true" usepoms="true"
      pattern="[organization]/jars/[module]-[revision].[ext]"/>

      If that helps, could you please open a JIRA ticket?

      Maarten

      ----- Original Message ----
      From: Daniel Nielsen <Daniel.Nielsen@blipsystems.com>
      To: "ivy-user@ant.apache.org" <ivy-user@ant.apache.org>
      Sent: Tuesday, February 3, 2009 2:41:03 PM
      Subject: Snapshot issue?!

      Hi.

      I'm currently evaluating Ivy 2.0.0 for our dependency management. I like what I've seen so far, but now I've run into trouble.

      We use JSFUnit for our testcases and we use the snapshot versions.

      To make Ivy fetch these dependencies I have the following ivy settings: (the properties file contains only version numbers and repository locations)

      <?xml version="1.0" encoding="UTF-8"?>
      <ivysettings>
      <settings defaultResolver="default"/>
      <properties file="${ivy.settings.dir}/ivysettings.properties"/>
      <caches artifactPattern="[organisation]/[module]/[type]s/[artifact][revision]([classifier]).[ext]"
      checkUpToDate="true"/>
      <resolvers>
      <filesystem name="project">
      <ivy pattern="${basedir}/lib/ivy-repo/[organisation]/[module]/ivy-[revision].xml"/>
      <artifact pattern="${basedir}/lib/ivy-repo/[organisation]/[module]/[artifact][revision]([classifier]).[ext]"/>
      </filesystem>
      <ibiblio name="central" m2compatible="true" usepoms="true" root="${central.repo}" />
      <ibiblio name="jboss" m2compatible="true" usepoms="true" root="${jboss.repo}" />
      <ibiblio name="jboss-snapshot" m2compatible="true" usepoms="true" root="${jboss.snapshotrepo}" />
      <ibiblio name="java.net" root="${java.net.repo}"
      pattern="[organization]/jars/[module]-[revision].[ext]"/>
      <chain name="default" returnFirst="true">
      <resolver ref="project" />
      <resolver ref="central"/>
      <resolver ref="jboss-snapshot"/>
      <resolver ref="jboss"/>
      <resolver ref="java.net"/>
      </chain>
      </resolvers>
      </ivysettings>

      And try to fetch jsfunit snapshot with an ivy.xml file:

      <ivy-module version="2.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:m="http://ant.apache.org/ivy/maven"
      xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
      <info organisation="com.blipsystems.analyzer" module="test-jsf"/>
      <configurations>
      <conf name="default" transitive="false"/>
      <conf name="jsfunit" transitive="true"/>
      </configurations>
      <dependencies defaultconf="default">

      <dependency org="org.jboss.jsfunit" name="jboss-jsfunit" rev="1.0.0.GA-SNAPSHOT" conf="jsfunit->default" />
      <!-<dependency org="org.jboss.jsfunit" name="jboss-jsfunit-core" rev="1.0.0.GA-SNAPSHOT" changing="true" conf="jsfunit>default" />-->

      <!-<dependency org="org.jboss.jsfunit" name="jboss-jsfunit-ant" rev="1.0.0.GA-SNAPSHOT" changing="true" conf="jsfunit>default" />-->
      <!-<dependency org="org.jboss.jsfunit" name="jboss-jsfunit-richfaces" rev="1.0.0.GA-SNAPSHOT" changing="true" conf="jsfunit>default" />-->
      <!-<dependency org="org.jboss.jsfunit" name="jboss-jsfunit-analysis" rev="1.0.0.GA-SNAPSHOT" changing="true" conf="jsfunit>default" />-->
      <!-- snip other dependencies for default configuration -->

      </dependencies>
      </ivy-module>

      The following is the output of a <ivy:resolve> run from ant with verbose output:

      [ivy:resolve] == resolving dependencies com.blipsystems.analyzer#test-jsf;working@danipc1->org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT [jsfunit->default] [ivy:resolve] default: Checking cache for: dependency: org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT

      {jsfunit=[default]}
      [ivy:resolve] tried c:\Users\dani.BSH\work\analyzer-trunk/lib/ivy-repo/org.jboss.jsfunit/jboss-jsfunit/ivy-1.0.0.GA-SNAPSHOT.xml
      [ivy:resolve] tried c:\Users\dani.BSH\work\analyzer-trunk/lib/ivy-repo/org.jboss.jsfunit/jboss-jsfunit/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] project: no ivy file nor artifact found for org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT
      [ivy:resolve] don't use cache for org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT: changing=true [ivy:resolve] CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/maven-metadata.xml
      [ivy:resolve] maven-metadata not available: http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/maven-metadata.xml
      [ivy:resolve] tried http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.pom
      [ivy:resolve] CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.pom
      [ivy:resolve] maven-metadata not available: http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/maven-metadata.xml
      [ivy:resolve] tried http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] central: no ivy file nor artifact found for org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT
      [ivy:resolve] don't use cache for org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT: changing=true [ivy:resolve] [1.0.0.GA-20090129.125050-9] org/jboss/jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT
      [ivy:resolve] tried http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.pom
      [ivy:resolve] jboss-snapshot: found md file for org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT
      [ivy:resolve] => http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.pom (1.0.0.GA-SNAPSHOT)
      [ivy:resolve] downloading http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.pom ...
      [ivy:resolve] jboss-snapshot: downloading http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.pom
      [ivy:resolve] jboss-snapshot: downloading http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.pom.sha1
      [ivy:resolve] sha1 OK for http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.pom
      [ivy:resolve] [SUCCESSFUL ] org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT!jboss-jsfunit.pom(pom.original) (869ms)
      [ivy:resolve] default: Checking cache for: dependency: org.jboss#jboss-parent;3 {} [ivy:resolve] default: module revision found in cache: org.jboss#jboss-parent;3
      [ivy:resolve] tried c:\Users\dani.BSH\work\analyzer-trunk/lib/ivy-repo/org.jboss.jsfunit/jboss-jsfunit/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] maven-metadata not available: http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/maven-metadata.xml
      [ivy:resolve] tried http://repo1.maven.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] tried http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.jar
      [ivy:resolve] CLIENT ERROR: Not Found url=http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-20090129.125050-9.jar
      [ivy:resolve] tried http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] CLIENT ERROR: Not Found url=http://snapshots.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] CLIENT ERROR: Not Found url=http://repository.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/maven-metadata.xml
      [ivy:resolve] maven-metadata not available: http://repository.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/maven-metadata.xml
      [ivy:resolve] tried http://repository.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] CLIENT ERROR: Not Found url=http://repository.jboss.org/maven2/org/jboss/jsfunit/jboss-jsfunit/1.0.0.GA-SNAPSHOT/jboss-jsfunit-1.0.0.GA-SNAPSHOT.jar
      [ivy:resolve] problem occured while resolving dependency: org.jboss.jsfunit#jboss-jsfunit;1.0.0.GA-SNAPSHOT {jsfunit=[default]}

      with jboss-snapshot: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      [ivy:resolve] at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      [ivy:resolve] at java.util.ArrayList.get(ArrayList.java:322)
      [ivy:resolve] at java.util.Collections$UnmodifiableList.get(Collections.java:1154)
      [ivy:resolve] at org.apache.ivy.plugins.resolver.IBiblioResolver.findSnapshotVersion(IBiblioResolver.java:161)

      The jboss-jsfunit is a pom declaring only dependencies with no jars, but Ivy apparently expects an jar to download? Ivy identifies the correct snapshot version, but I don't get why it tries to download the jboss-jsfunit jar.

      I've tried listing the stuff I need from jsfunit (jboss-jsfunit-core etc) but these poms have a <parent> attribute naming jboss-jsfunit and ivy resolves this parent regardless of transitive settings.

      Am I doing something wrong or is this a bug in Ivy?

      Attachments

        1. IVY-1028-1.patch
          0.6 kB
          David Schlosnagle
        2. IVY-1028-3.patch
          0.6 kB
          David Schlosnagle

        Activity

          People

            maartenc Maarten Coene
            djn Daniel Nielsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: