[SOLVED] Strange issue when using local Ivy repo


(Schalk Cronjé) #1

I should not even need to be asking this question, I think, but I need to as I simply cannot get this to work.

repositories {
    ivy {
        url '../../repository'
        layout 'ivy'
    }
}

apply plugin : 'groovy'

dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.4.3'
}

This fails with

:compileGroovy

FAILURE: Build failed with an exception.

* What went wrong:
Cannot infer Groovy class path because no Groovy Jar was found on class path: configuration ':compileClasspath'

If I changed the repo so something else i.e.

repositories {
    ivy {
        url '../../repository2'
        layout 'ivy'
    }
}

then it fails with

:compileGroovy

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find org.codehaus.groovy:groovy-all:2.4.3.
  Searched in the following locations:
      file:/Users/schalkc/..../repository2/org.codehaus.groovy/groovy-all/2.4.3/ivys/ivy.xml
      file:/Users/schalkc/..../repository2/org.codehaus.groovy/groovy-all/2.4.3/jars/groovy-all.jar

This is telling me that Gradle is finding the artifacts in the original code. (Changin the repositories just to use jcenter() works, so I know that the build script is not broken).

The files are all there

../../repository/org.codehaus.groovy/groovy-all/2.4.3
../../repository/org.codehaus.groovy/groovy-all/2.4.3/ivys
../../repository/org.codehaus.groovy/groovy-all/2.4.3/ivys/ivy.xml
../../repository/org.codehaus.groovy/groovy-all/2.4.3/jars
../../repository/org.codehaus.groovy/groovy-all/2.4.3/jars/groovy-all.jar
../../repository/org.codehaus.groovy/groovy-all/2.4.3/javadocs
../../repository/org.codehaus.groovy/groovy-all/2.4.3/javadocs/groovy-all.jar
../../repository/org.codehaus.groovy/groovy-all/2.4.3/pom.originals
../../repository/org.codehaus.groovy/groovy-all/2.4.3/pom.originals/groovy-all.pom.original
../../repository/org.codehaus.groovy/groovy-all/2.4.3/sources
../../repository/org.codehaus.groovy/groovy-all/2.4.3/sources/groovy-all.jar
../../repository/org.codehaus.groovy/groovy-all/ivydata-2.4.1.properties
../../repository/org.codehaus.groovy/groovy-all/ivydata-2.4.3.properties

I am just confused.

(P.S. Tested with both Gradle 2.12 & 2.5)


Scala compilation does not resolve dependencies correctly when not using jcenter
Gradle & Scala builds both fail if only repository is an Ivy one and te layout is Ivy
(Schalk Cronjé) #2

I got to the bottom of this - Gradle & Scala builds both fail if only repository is an Ivy one and te layout is Ivy