I’m trying to publish a new plugin for JProfiler integration to the Gradle plugin portal using Gradle 4.1. The publishing task is successful and prints:
Publishing plugin com.jprofiler version 10.1-PRE3
Publishing artifact file:/Users/ingo/projects/jprofiler/build/gradle/jprofiler/buildtools/gradle_publish/libs/jprofiler-gradle.jar
Publishing artifact file:/Users/ingo/projects/jprofiler/build/gradle/jprofiler/buildtools/gradle_publish/publish-generated-resources/pom.xml
Activating plugin com.jprofiler version 10.1-PRE3
However, when I try to use the plugin via
plugins {
id 'com.jprofiler' version '10.1-PRE1'
}
the artifacts cannot be downloaded. The output is
Could not find gradle.plugin.jprofiler.jprofiler.buildtools:gradle_publish:10.1-PRE3.
Searched in the following locations:
https://plugins.gradle.org/m2/gradle/plugin/jprofiler/jprofiler/buildtools/gradle_publish/10.1-PRE3/gradle_publish-10.1-PRE3.pom
https://plugins.gradle.org/m2/gradle/plugin/jprofiler/jprofiler/buildtools/gradle_publish/10.1-PRE3/gradle_publish-10.1-PRE3.jar
I’ve first used the publishing plugin like that:
plugin {
id 'com.gradle.plugin-publish'
}
as I have successfully done in the past for another plugin. Then, upon reading that version 0.9.7 of the publishing plugin is now required, I tried
plugin {
id 'com.gradle.plugin-publish' version '0.9.7'
}
as described here: https://guides.gradle.org/publishing-plugins-to-gradle-plugin-portal/
which produces the error:
Error resolving plugin [id: 'com.gradle.plugin-publish', version: '0.9.7']
Plugin 'com.gradle.plugin-publish' is already on the script classpath.
Plugins on the script classpath cannot be applied in the plugins {} block.
although I have not put that plugin on the script classpath myself.
Using the buildscript
syntax
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
}
}
works, but the problem of the missing artifacts is not solved.
I’ve tried this several times with various local modifications, then with the theory that you could not have a plugin ID with two parts, so I tried the ID ‘com.jprofiler.gradle’ but the problem remains.
Could you please have a look at this?