Can't publish gradle plugin

Hello there,

I’d like to post a new release of the org.kordamp.markdown.convert plugin to the new plugin portal, but also to my own Bintray repository. The latest version of the codebase is available at https://github.com/aalmiray/markdown-gradle-plugin/commit/011c39f70c04fec68930d30b2f3a61879bd2c9c5

The project applies the following plugins

plugins { id 'com.jfrog.bintray' version '1.6' id 'com.github.hierynomus.license' version '0.11.0' id 'net.nemerosa.versioning' version '1.7.1' id 'com.github.ben-manes.versions' version '0.12.0' id 'com.gradle.plugin-publish' version '0.9.4' id 'com.github.kt3k.coveralls' version '2.6.3' id 'idea' id 'groovy' id 'maven-publish' }

Invoking gradlew bintrayUpload results in all artifacts uploaded to Bintray. Everything works.
Invoking gradlew publishPlugins results in the following stacktrace

Caused by: java.lang.NoSuchMethodError: org.apache.maven.model.Dependency.getOptional()Ljava/lang/String; at com.gradle.publish.PomWriter.addDependency(PomWriter.java:56) at com.gradle.publish.PomWriter.createPomDocument(PomWriter.java:42) at com.gradle.publish.PomWriter.writePom(PomWriter.java:28) at com.gradle.publish.PublishTask.generatePom(PublishTask.java:130) at com.gradle.publish.PublishTask.publish(PublishTask.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) 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) ... 71 more

Any clues on how to fix this would be greatly appreciated, as these settings will be applied to jmh, jbake, and asciidoctor plugins too.

I had the exact same problem. Setting the version for com.gradle.plugin-publish to 0.9.1 (down from the latest 0.9.4) fixed it for me.

Same problem here. In my case it’s the combination of
com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3 with
com.gradle.publish:plugin-publish-plugin:0.9.4.

Using com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5 makes publishing work again.

Reproducible with https://github.com/gesellix/gradle-docker-plugin/commit/c2c81410f702f743eb9c0f2d88af6d888bf39824.

It seems that the plugins may be interfering with one another.

I’ve personally been able to fix this with https://github.com/eriwen/gradle-js-plugin/commit/cf8055de3175ad514837d46e045d841b1625e534 as mentioned on Twitter.

Please let us know if that does not solve your issue. I expect we’ll file a bug on the bintray plugin or fix this in plugin-publishing in a future version

Reordering the buildscript classpath worked (https://github.com/gesellix/gradle-docker-plugin/commit/819c9626559f6325bd01b9ee52ff8204729370e2).

Thanks!

1 Like