Using a released plugin when building the same plugin causes error

TL;DR: This repo does not build, why? GitHub - tomasbjerre/gcgp-bug

If:

Than the build will crash with:

Could not apply requested plugin [id: 'se.bjurr.gitchangelog.git-changelog-gradle-plugin', version: '2.2.1'] as it does not provide a plugin with id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s).
> Plugin with id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' not found.

I created a minimal example with this problem:

My actual real world use case is here:

I started experiencing this when moving shared code from:

I was using it like this:

Now I moved that code to:

I am using it like this:

I’m thinking now that I am using groovy-gradle-plugin to build conventional-release-gradle-plugin there is some difference in isolation of dependency.

How can I solve this?

I’m using:

openjdk version "17.0.10" 2024-01-16 LTS
OpenJDK Runtime Environment Zulu17.48+15-CA (build 17.0.10+7-LTS)
OpenJDK 64-Bit Server VM Zulu17.48+15-CA (build 17.0.10+7-LTS, mixed mode, sharing)

I have to admit I didn’t read all of your post, but from what I have read, I’d say you are hitting this issue: I can’t I use the previous version of a plugin in the plugin’s project itself? · Issue #30427 · gradle/gradle · GitHub.

If you ignore the work-arounds mentioned by Gradle folks and just add id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "2.2.1" apply false to your settings script and remove the version from your build script, then it should work if it is that same issue which I assume.

1 Like