ModuleVersionNotFoundException for maven dependencies in local repository


(Marek Zganiacz) #1

What can cause a org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException for maven dependencies installed (manually) in local repository?

FAILURE: Build failed with an exception.
  * What went wrong:
Could not find group:com, module:lastfmbindings, version:160-SVN.
Required by:
    fairPlayer:aTunesEngine:1.0-SNAPSHOT
  * Try:
Run with --debug option to get more log output.
  * Exception is:
org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException: Could not find group:com, module:lastfmbindings, version:160-SVN.
Required by:
    fairPlayer:aTunesEngine:1.0-SNAPSHOT
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.IvyResolverBackedDependencyToModuleResolver$DefaultModuleVersionResolver.notFound(IvyResolverBackedDependencyToMo
duleResolver.java:125)

In master build.gradle I have defined:

allprojects
{
 usePlugin('java')
 usePlugin('maven')
   group = 'fairPlayer'
 version = '1.0-SNAPSHOT'
   configurations.compile.transitive = true
}
  subprojects {
 sourceCompatibility = 1.5
 targetCompatibility = 1.5
   repositories {
       mavenLocal()
 }
     }
  dependsOnChildren()

and in one of submodules:

dependencies {
 compile group: 'fairPlayer.includes', name: 'lastfm-bindings', version: '160-SVN'
}

and I have “lastfm-bindings-160-SVN.jar” and “lastfm-bindings-160-SVN.pom” in ~.m2\repository\fairplayer\includes\lastfm-bindings\160-SVN\

I’m using 1.0-milestone7

Whats wrong?


(Marek Zganiacz) #2

both groupId and dir should be named “fairplayer” instead of “fairPlayer”. Gradle seems to dump groupId to lowercase and then search for artifact


(Peter Niederwieser) #3

Are you saying that your problem is solved?

PS: Please don’t double-post here and on Stack Overflow.


(Marek Zganiacz) #4

Solved!


(Adam Murdoch) #5

Gradle does a case sensitive match on the groupId and the directory name, so they have to match. So, if your dependency is declared as ‘group: ‘fairPlayer.includes’’, it will look for a directory called ‘fairPlayer/includes’.

It doesn’t convert the groupId to lowercase.