Custom plugin jar META-INF/gradle-plugins properties file not found Error

I’m creating a custom plugin. Following the docs I have created the class, add the META-INF/gradle-plugins .properties file, built and installed to my local .m2 repo. Now testing in another project I have defined it in the build script as: buildscript {

repositories {



dependencies {

classpath group: ‘com.spindrift’, name: ‘spindrift-gradle-plugins’, version: ‘0.1-SNAPSHOT’

} }

//apply plugin: ‘spindrift-gradle-plugins’ project.plugins.apply(‘spindrift-gradle-plugins’)

but when executing the build it throws:

FAILURE: Build failed with an exception.

  • Where: Build file ‘/Users/warren/Documents/workspace/TestMyScripts/build.gradle’ line: 13

  • What went wrong: A problem occurred evaluating root project ‘TestMyScripts’. Cause: JAR entry META-INF/gradle-plugins/ not found in /Users/warren/.m2/repository/com/spindrift/spindrift-gradle-plugins/0.1-SNAPSHOT/spindrift-gradle-plugins-0.1-SNAPSHOT.jar

But when I unjar that snapshot it exists correctly. The path to the snapshot is valid and the path to the .properties is valid.

Any ideas why it can’t see/access the file - permissions are not a problem I think. I am using Gradle 1.0-milestone-5

I suspect a typo in the path :slight_smile:

To avoid plugin id resolving and move forward you can apply plugin by class:

apply plugin:

Hope that helps!

No typo :slight_smile:

Problem is resolved. Some more digging led me to a bug in JDK1.4 and it seems its similar behaviour. I have 2 windows 1 - I am building an installing the plugin to my local .m2 (this works fine) 2 - I am calling and testing in a test project. So it fails sometimes. If I delete the .m2 entry and install again then it works fine, although sometime the gradle daemon fails so I have to run gradle -stop as well. So cleanest sequence is 1. delete from .m2 repo 2. gradle install (from 1) 3. gradle build (or whatever) from 2)

Just to be clear I’m not using 1.4 its just similar behaviour … I’m on 1.6 latest and m5

I had a similar problem as you with the same error message. Took me a while to track it down, but in my case it was the gradle daemon that was the problem. Killing and restarting the daemon resolved the issue. What seems to be happening is that the daemon has the class loaded, but if the original file changes, the daemon gets all confused.

1 Like

Hi Warren,

Can you please confirm that you are using the Gradle daemon. If so, then I’m pretty sure that the JDK issue you found is the culprit. If this is the case I think we can workaround this in Gradle.

Hi Luke, Yes I am using the daemon. I normally have 2 window one for running gradle install with the maven plugin to push the new version to my .m2 repo. Then in the second I have the demo project and I do whatever gradle . If that task is from the plugin I have just updated it normally always fails. So the easiest path to this is I just stop the daemon then call my task again. If I don’t stop the daemon I get the FNFE. This is development on the Mac with version 1.6.0_29 tx

I’ve turned this into a problem to be solved.

Warren, can you please run with the -s option (show full stacktrace) and put the stacktrace here.

Note: the Gradle build daemon is an experimental feature. As such, you may experience unexpected build failures. You may need to occasionally stop the daemon.

FAILURE: Build failed with an exception.

  • Where: Build file ‘/Users/warren/Documents/workspace/ProjectBuildReference/build.gradle’ line: 30

  • What went wrong: A problem occurred evaluating root project ‘ProjectBuildReference’. Cause: JAR entry META-INF/gradle-plugins/ not found in /Users/warren/.m2/repository/com/spindrift/tools/gradle/plugins/SpindriftCommonPlugin/0.1-SNAPSHOT/SpindriftCommonPlugin-0.1-SNAPSHOT.jar

  • Try: Run with --info or --debug option to get more log output.

  • Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project ‘ProjectBuildReference’.

at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$

at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(

at org.gradle.configuration.BuildScriptProcessor.evaluate(

at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(

at org.gradle.api.internal.project.AbstractProject.evaluate(

at org.gradle.api.internal.project.AbstractProject.evaluate(

at org.gradle.configuration.ProjectEvaluationConfigurer.execute(

at org.gradle.configuration.ProjectEvaluationConfigurer.execute(

at org.gradle.configuration.DefaultBuildConfigurer$1.execute(

at org.gradle.configuration.DefaultBuildConfigurer$1.execute(

at org.gradle.api.internal.project.AbstractProject.configure(

at org.gradle.api.internal.project.AbstractProject.allprojects(

at org.gradle.configuration.DefaultBuildConfigurer.configure(

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(

at org.gradle.initialization.DefaultGradleLauncher.doBuild(



at org.gradle.launcher.exec.DefaultGradleLauncherActionExecuter.execute(

at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(

at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(

at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.HandleSleep.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.ReportExceptions.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.ForwardOutput.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.ForwardClientInput$

at org.gradle.launcher.daemon.server.exec.ForwardClientInput$

at org.gradle.util.Swapper.swap(

at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.UpdateDaemonStateAndHandleBusyDaemon.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.HandleStop.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.HandleClientDisconnectBeforeSendingCommand.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.StopConnectionAfterExecution.execute(

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(

at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(

at org.gradle.launcher.daemon.server.Daemon$1$

at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$ Caused by: org.gradle.api.UncheckedIOException: JAR entry META-INF/gradle-plugins/ not found in /Users/warren/.m2/repository/com/spindrift/tools/gradle/plugins/SpindriftCommonPlugin/0.1-SNAPSHOT/SpindriftCommonPlugin-0.1-SNAPSHOT.jar

at org.gradle.util.GUtil.loadProperties(

at org.gradle.api.internal.plugins.DefaultPluginRegistry.getTypeForId(

at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.getTypeForId(

at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$

at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(

at org.gradle.api.internal.project.AbstractProject.apply(

at org.gradle.api.Project$ Source)

at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:35)

at org.gradle.api.Script$apply.callCurrent(Unknown Source)


at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$

… 53 more Caused by: JAR entry META-INF/gradle-plugins/ not found in /Users/warren/.m2/repository/com/spindrift/tools/gradle/plugins/SpindriftCommonPlugin/0.1-SNAPSHOT/SpindriftCommonPlugin-0.1-SNAPSHOT.jar

at org.gradle.util.GUtil.loadProperties(

… 66 more


Total time: 0.615 secs

Even though the error says the .properties is not found thats misleading as its there. HTH

The problem is that the JDK internally caches parts of JAR files. We are looking into it. The workaround for the time being is to not use the daemon.

any news? I’m facing this issue right now with Gradle 1.7

To be honest I have not had a problem for a long time now - we’re running on 1.6 and I do this quite often i.e. building the plugin in 1 tab and executing it in a test project in another from mavenLocal(). Its been very stable - however we don’t use the daemon that often - only when I remember :slight_smile: But I will test again when I upgrade to 1.7

Indeed, for now I’m forced to not use the daemon, it is slow…er :slight_smile: I have the exact same setup as you too, building my plugin, installing in to local repo and then testing it right away.

I’ve just run a test from on biggest project 1. Delete .gradle directory (not the ~/.gradle) 2. gradle clean build

1.6 : Total time: 2 mins 21.429 secs 1.7 : Total time: 3 mins 15.916 secs

That might not be a fair reflection but interesting to see if/what has slowed down in 1.7 as it was supposed to be a lot faster