Skip to content

Commit 73cd0eb

Browse files
committed
Replace deprecated Jar.classifier with archiveClassifier
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>
1 parent af0ef1f commit 73cd0eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jar {
7171
}
7272

7373
task sourceJar(type: Jar, dependsOn: classes) {
74-
classifier = 'sources'
74+
archiveClassifier = 'sources'
7575
from sourceSets.main.allJava
7676
}
7777

@@ -91,7 +91,7 @@ publishing {
9191
from components.java
9292

9393
artifact sourceJar {
94-
classifier 'sources'
94+
archiveClassifier = 'sources'
9595
}
9696
}
9797
}

0 commit comments

Comments
 (0)