Replace deprecated Jar.classifier with archiveClassifier#192
Open
Tuguberk wants to merge 1 commit into
Open
Conversation
The Jar task property `classifier` was deprecated in Gradle 5.1 and removed in Gradle 7.0. Builds using Gradle 7+ fail with: Could not set unknown property 'classifier' for task ':idl-parser:sourceJar' of type org.gradle.api.tasks.bundling.Jar. Replace both usages with the current `archiveClassifier` property, which has been available since Gradle 5.1 and is the supported API going forward. This unblocks projects that depend on IDL-Parser (e.g. Fast-DDS-Gen) from upgrading their Gradle wrapper to 7.x or later. Signed-off-by: Tuguberk <akbulut.tugberk@gmail.com>
ff3ea48 to
73cd0eb
Compare
Tuguberk
added a commit
to Tuguberk/Fast-DDS-Gen
that referenced
this pull request
May 12, 2026
Gradle 7.6 supports Java up to version 19. Building Fast-DDS-Gen on systems where Java 21 is the default JDK fails with: BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 Class file major version 65 corresponds to Java 21. Gradle 8.5 introduced official Java 21 support. This change upgrades the Gradle wrapper to 8.5, which supports Java 11 through 21. The build itself continues to compile sources to Java 8 bytecode (sourceCompatibility/targetCompatibility = 1.8 in build.gradle), so the produced fastddsgen.jar remains compatible with any Java 8+ runtime. Note: this change depends on eProsima/IDL-Parser#192, which replaces the deprecated Jar.classifier property (removed in Gradle 7) with archiveClassifier. Without that fix, the IDL-Parser submodule build fails under Gradle 7+. Signed-off-by: Tuguberk <akbulut.tugberk@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building IDL-Parser with Gradle 7.0 or later fails during configuration:
This blocks consumers of IDL-Parser (notably Fast-DDS-Gen) from upgrading their Gradle wrapper beyond 6.x, which in turn prevents building on systems running Java 11+ as the primary JDK.
Root cause
The
classifierproperty onJartasks was deprecated in Gradle 5.1 and removed in Gradle 7.0. Two usages remain inbuild.gradle:Fix
Replace both with
archiveClassifier, the supported API since Gradle 5.1:Impact
sourcesclassifier.archiveClassifieris available from Gradle 5.1 onward.Testing
Verified that IDL-Parser builds cleanly under Gradle 8.5 with Java 21 after this change, as part of a full Fast-DDS-Gen build on macOS arm64.