ice icon indicating copy to clipboard operation
ice copied to clipboard

Warnings about deprecated usage of GradleVersion

Open Lastique opened this issue 2 months ago • 4 comments

Version

  • Ice version: 3.7.10
  • OS: Debian 13 Trixie, gradle 4.4.1 from Debian packages

Describe the bug

When building Ice 3.7.10 on Debian 13 Trixie, the Java and Java-compat parts of the build show warnings like this:

Compiling script '/build/zeroc-ice/ice/java/gradle/ice.gradle' using BuildScriptTransformer.
Script '/build/zeroc-ice/ice/java/gradle/ice.gradle' is using GradleVersion from the private org.gradle.util package without an explicit import. Please either stop using these internal classes (recommended) or import them explicitly at the top of your build file. The implicit import is deprecated and will be removed in Gradle 5.0

Full build log: ice_build_log.txt

Basically, this warning is shown for every gradle file that mentions GradleVersion.

I'm not sure what would be the correct fix for this, since, as the warning says, GradleVersion is an internal implementation detail and users are not supposed to use it. Importing org.gradle.util might silence the warnings but would leave the build scripts open for breakage in the future, if gradle removes or changes the meaning of GradleVersion.

Expected behavior

There should be no warnings.

Additional context

This issue was mentioned previously here, but I don't think it was fixed.

Lastique avatar Oct 03 '25 20:10 Lastique

Hi @Lastique,

Thanks for remembering this. We’ll try to fix it in the next 3.7 patch release. We don’t have a release date yet, but I’ve just added this issue to the 3.7.11 milestone.

For the upcoming 3.8 release, we’ve removed support for older Gradle versions, and we’ll only support builds using the Gradle wrapper. Furthermore, Ice for Java will be distributed exclusively through the Maven Central repository and will no longer be included as RPM or DEB packages.

pepone avatar Oct 07 '25 16:10 pepone

For the upcoming 3.8 release, we’ve removed support for older Gradle versions, and we’ll only support builds using the Gradle wrapper. Furthermore, Ice for Java will be distributed exclusively through the Maven Central repository and will no longer be included as RPM or DEB packages.

This will be a major problem for us since we build DEB packages with Java applications that use ICE. Naturally, ICE Java support has to be built as a DEB package as well for this to work.

Furthermore, in order to build ICE packages, the building environment must be fixed, including the Gradle version. So far we have used (as was recommended) the Gradle version that was available in the distro (e.g. Debian) to achieve this. Package builds must be reproducible, which means e.g. pulling the latest Gradle from network as part of the build process is not acceptable.

Lastique avatar Oct 07 '25 21:10 Lastique

Are any such packages distributed through the official Debian repositories? My understanding is that the limitation of using only DEB packages for dependencies does not apply to packages distributed through other repositories.

For example the 3.7 DEB packages in ZeroC's own repository are built using the Gradle wrapper, and only the packages in the official Debian repository are built offline with the Gradle version from Debian.

We have also moved to a Kotlin based plugin, and my understanding is that those are not yet available in Debian.

pepone avatar Oct 07 '25 21:10 pepone

Are any such packages distributed through the official Debian repositories? My understanding is that the limitation of using only DEB packages for dependencies does not apply to packages distributed through other repositories.

We maintain our own DEB repositories that are used as an overlay on top of the official Debian repositories. When building our packages, we try to follow the same rules as those used by Debian. Reproducibility is one of such rules, it is very important for us.

I should add that at some point we did use Gradle versions that were referenced in ICE sources. But that caused issues (e.g. here) because of incompatibilities with other Debian packages, so we stopped doing that.

Lastique avatar Oct 07 '25 21:10 Lastique