MIssing artifacts for published plugin

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?

Hi @ingokegel,

Firstly, sorry for the delay in getting back to you.

I can see the builds being pushed in the logs, but as you say they are not making it in to the repo successfully, will fail when the build tries to resolve them…

This does look like the issue we had with old versions of the publishing plugin.

Is your build.gradle or project available anywhere for me to have a look? No worries if not, I’ll try and get a reproducer on my end, to see if I can see what is going on.

Cheers,

Tim

Hi @tim_yates,

Sorry for wasting your time, while trying to create something reproducible, I discovered that I actually put 0.9.4 of the gradle publishing plugin on the script classpath in my buildSrc. When I removed that dependency, it worked.

Could you be so kind as to remove the following plugin versions:

com.jprofiler:10.1-PRE1
com.jprofiler:10.1-PRE2
com.jprofiler:10.1-PRE3
com.jprofiler:10.1-PRE4
com.jprofiler.gradle:10.1-pre4 ( I won’t use that ID at all)

No worries at all! I’m glad you got to the bottom of it :smiley:

I’ll get on to deleting those now, and will post here when they’re gone

Cheers,

Tim

That should all be done now :smiley:

Glad I could help!

Good luck, and have fun!

Tim

1 Like