Open 3ric-T opened 1 year ago
gradle-docker-plugin
from version 3.2.1
to latest 9.2.1
.
In this case, build fails with java.lang.UnsupportedClassVersionError
and without any experience in groovy, I don't know how to deal with.@3ric-T Thanks for submitting this issue
I have the same problem. Unfortunately I'm not familiar enough with plugin development to resolve this properly. However I come with workaround and decided to use some ugly hack to resolve this ASAP. I'm using only part of `gradle.ospackage.plugin', so I'm not applying it, but manually registering only required parts. I wasn't testing generated package yet, but it looks valid. Here is part of my build.gradle script:
plugins {
id 'com.netflix.nebula.ospackage' version '11.0.0' apply false
id 'com.bmuschko.docker-remote-api' version '9.2.1'
id 'java'
}
var extension = project.extensions.create('ospackage', com.netflix.gradle.plugins.packaging.ProjectPackagingExtension, project)
com.netflix.gradle.plugins.rpm.RpmPlugin.applyAliases(extension)
project.plugins.apply(com.netflix.gradle.plugins.rpm.RpmPlugin)
project.tasks.register('buildRpm', com.netflix.gradle.plugins.rpm.Rpm)
Thanks for this workaround, @karbi ! It will be very useful, indeed, as you, I'm using only the RPM part of the ospackage plugin. On the other hand, it seems that the affected lines are in an abandoned piece of code. Instead of deleting this part, I tried to comment out the line that caused the error. After that, it works perfectly with the docker plugin. So I intend to submit a patch in the next few days to fix this problem.
@3ric-T Anything happening on this issue?
@gjvoosten No news unfortunately.
We finally migrate from
[versions]
ospackagePluginVersion = "11.0.0"
[plugins]
osPackage = { id = "com.netflix.nebula.ospackage", version.ref="ospackagePluginVersion" }
to
[versions]
ospackagePluginVersion = "11.3.0"
[plugins]
osPackage = { id = "com.netflix.nebula.rpm", version.ref = "ospackagePluginVersion" }```
which seems to be the RPM dedicated part of the preceding but packaged alone. So it does not suffer from the bug.
Thanks @3ric-T, as it happens we also only need Rpm, so we'll be making the same change.
Expected Behavior
As a user of
gradle-ospackage-plugin
plugin, I want to have a plugin which runs together with latest version ofgradle-docker-plugin
under version 8.0 of gradle wrapper So that I can build both Docker images and RPM packages of my application in the same projectCurrent Behavior
Build fails with the following error:
Partial stacktrace is:
Full stacktrace is attached to the issue
With version 7.6 of Gradle, there is no issue. It seems that you are using an outdated version of
docker-remote-api
in rootbuild.gradle
file:and it can be related to the deprecation of some convention mapping as stated in the error message.
Context
Simple declaration of the plugin, via version catalog file
libs.versions.toml
:Steps to Reproduce (for bugs)
Just declare the plugin as above in build file with Kotlin DSL. Any call to a Gradle task make it fail. IntelliJ IDEA project is attached to the issue, so that the bug can be easily reproduced.
Your Environment
Gradle 8.0 Openjdk version "17.0.5"