No meta-data file or artifact found for module


(Noel Yap) #1

My build.gradle has something that looks like:

buildscript {
//  final netflix_grpc_plugins_version = '0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2'
  final netflix_grpc_plugins_version = '0.+'

  repositories {
    ivy {
      url "${rootDir}/../../../../common/build/distIvy"
    }
    ivy {
      url "${rootDir}/../../../../client-guice/build/distIvy"
    }
    ivy {
      url "${rootDir}/../../../../proto-definition/build/distIvy"
    }
    ivy {
      url "${rootDir}/../../../../server-guice/build/distIvy"
    }
  }

  dependencies {
    classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.+'

    classpath "netflix.protoc-plugins:netflix-grpc-plugin-client-guice:${netflix_grpc_plugins_version}"
    classpath "netflix.protoc-plugins:common:${netflix_grpc_plugins_version}"
    classpath "netflix.protoc-plugins:netflix-grpc-plugin-proto-definition:${netflix_grpc_plugins_version}"
    classpath "netflix.protoc-plugins:netflix-grpc-plugin-server-guice:${netflix_grpc_plugins_version}"
  }
}

When the dynamic version is used, the build errors with:

…
16:52:40.245 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2 using repositories [maven, maven2, nfrepo-everythingRepo, ivy, ivy2, ivy3, ivy4]
16:52:40.245 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2' in resolver cache 'maven'
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2' in resolver cache 'maven2'
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2' in resolver cache 'nfrepo-everythingRepo'
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/home/nyap/proj/create-gradle-plugins/netflix-protoc-plugins/client-guice/build/distIvy/netflix.protoc-plugins/common/0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2/ivy-0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2.xml
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/home/nyap/proj/create-gradle-plugins/netflix-protoc-plugins/client-guice/build/distIvy/netflix.protoc-plugins/common/0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2/common-0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2.jar
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2' in repository 'ivy'.
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Using netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2 from Ivy repository 'ivy2'
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler] Selected netflix.protoc-plugins:common:0.1.0-rc.1 from conflicting modules [netflix.protoc-plugins:common:0.1.0-rc.1, netflix.protoc-plugins:common:0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2].
16:52:40.246 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder] Visiting configuration netflix.protoc-plugins:common:0.1.0-rc.1(default).
…
Caused by: java.lang.ClassNotFoundException: com.netflix.grpc.gradle.GuicePluginBase

com.netflix.grpc.gradle.GuicePluginBase is defined in common.

When the exact version is used, the build succeeds. This seems to be a resolution bug. Strangely, the bug isn’t hit with anything defined in the other dependencies. common is the only one of them that isn’t a Gradle plugin so that may have something to do with it.

Double-checking the debug output, I don’t see the “No meta-data found” error for the client module:

16:52:40.446 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/home/nyap/proj/create-gradle-plugins/netflix-protoc-plugins/client-guice/build/distIvy/netflix.protoc-plugins/netflix-grpc-plugin-client-guice/0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2/netflix-grpc-plugin-client-guice-0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2-linux-x86_64.exe
16:52:40.446 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/home/nyap/proj/create-gradle-plugins/netflix-protoc-plugins/client-guice/build/distIvy/netflix.protoc-plugins/netflix-grpc-plugin-client-guice/0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2/netflix-grpc-plugin-client-guice-0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2.jar
16:52:40.446 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Found artifact 'common.jar (netflix.protoc-plugins:common:0.1.0-rc.1)' in resolver cache: /home/nyap/proj/create-gradle-plugins/.gradle/caches/modules-2/files-2.1/netflix.protoc-plugins/common/0.1.0-rc.1/b612afa7f1eec914cb55b248b5bdc23329e8574c/common-0.1.0-rc.1.jar

Searching for the common dependency in the ivy.xml file for client-guice:

    <dependency org="netflix.protoc-plugins" name="common" rev="0.1.0-rc.1.dev.7.uncommitted+create-gradle-plugins.ff4c8e2" conf="runtime-&gt;default"/>

It looks like Gradle is looking for the wrong version for common.