When running the publishPlugins
task, I’m encountering the following stacktrace
https://gist.github.com/kashike/047abbdea8b5794f5282
Gradle: 2.7 (c41505168da69fb0650f4e31c9e01b50ffc97893)
Plugin: id 'com.gradle.plugin-publish' version '0.9.1'
When running the publishPlugins
task, I’m encountering the following stacktrace
https://gist.github.com/kashike/047abbdea8b5794f5282
Gradle: 2.7 (c41505168da69fb0650f4e31c9e01b50ffc97893)
Plugin: id 'com.gradle.plugin-publish' version '0.9.1'
The root cause of this appears to be from the following exception:
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableList.of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList;
at com.gradle.publish.PluginPublishValidator.<clinit>(PluginPublishValidator.java:19)
at com.gradle.publish.PublishTask.publish(PublishTask.java:59)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
It appears that the plugin is using Google Guava. Is it possible your project has an older version Guava on the build classpath?
I’m not sure what Guava version the publish plugin uses, but I’m using 18.0, which has the method in question.
http://docs.guava-libraries.googlecode.com/git-history/v18.0/javadoc/com/google/common/collect/ImmutableList.html
The same issue occurs with the ImmutableList.of()
usage in the same file.
This is a really weird problem. I looked at the guava release notes and the of method has been there since version 2. I also can’t find any source for the plugin, so I can’t see what is going on at that method.
The only thing I could think of is there might be something with the build.gradle file. Could you please post it?