Closed SingingBush closed 2 years ago
Can you please provide a small github repo which demonstrates the problem?
The Bnd Gradle plugin source code does not reference COMPILE_CONFIGURATION_NAME
anywhere. And the provided stacktrace does not reference any Bnd Gradle plugin classes.
The referenced error message says the error is in applying the org.gradle.java
plugin.
> Failed to apply plugin 'org.gradle.java'.
> No such property: COMPILE_CONFIGURATION_NAME for class: org.gradle.api.plugins.JavaPlugin
The Bnd Gradle plugin does apply the java
plugin:
project.getPluginManager()
.apply("java");
The Gradle java plugin used to have a "compile" configuration but it has been deprecated and replaced. So perhaps you have some strange gradle setup.
Ah yes, sorry I did not notice the reference to java plugin. I have seen similar reports of this problem for other projects updating to Gradle 7.
I was on a fork of ical4j at the time that I am trying to update to Gradle 7 so that I can target JDK 17. I've pushed a branch for you: https://github.com/SingingBush/ical4j/tree/bnd_problem and the error can be seen here: https://github.com/SingingBush/ical4j/runs/6189652960?check_suite_focus=true
Your build.gradle
file had an awkward mix of the use of the plugins
section and apply plugin:
which probably was causing the issue. The plugin versions were also quite old. The following changes get your build working and show no issue in the Bnd Gradle plugin.
diff --git a/build.gradle b/build.gradle
index afcfa19d..fe161e92 100644
--- a/build.gradle
+++ b/build.gradle
@@ -10,21 +10,20 @@ buildscript {
}
plugins {
- id 'pl.allegro.tech.build.axion-release' version '1.13.3'
- id "nebula.provided-base" version "3.0.3"
- id "net.ltgt.errorprone" version "1.2.1" apply false
+ id 'java'
+ id 'java-library'
+ id 'groovy'
+ id 'maven-publish'
+ id 'jacoco'
+ id 'signing'
+ id "pl.allegro.tech.build.axion-release" version "1.13.6"
+ id "nebula.provided-base" version "7.0.0"
+ id "nebula.optional-base" version "7.0.0"
+ id "com.palantir.revapi" version "1.7.0"
+ id "net.ltgt.errorprone" version "2.0.2" apply false
id "biz.aQute.bnd.builder" version "$bndVersion"
}
-apply plugin: 'java'
-apply plugin: 'java-library'
-apply plugin: 'groovy'
-apply plugin: 'maven-publish'
-apply plugin: 'jacoco'
-apply plugin: 'signing'
-apply plugin: 'pl.allegro.tech.build.axion-release'
-apply plugin: 'nebula.optional-base'
-apply plugin: 'com.palantir.revapi'
apply from: 'gradle/dist.gradle'
sourceCompatibility = 1.8
@@ -64,7 +63,7 @@ dependencies {
compileOnly "biz.aQute.bnd:biz.aQute.bndlib:$bndVersion"
- testCompile "org.codehaus.groovy:groovy:$groovyVersion",
+ testCompileOnly "org.codehaus.groovy:groovy:$groovyVersion",
"org.slf4j:slf4j-log4j12:$slf4jVersion",
"org.apache.logging.log4j:log4j:$log4jVersion",
"org.ccil.cowan.tagsoup:tagsoup:$tagsoupVersion",
Thanks, I really appreciate your help on this. I had to fix some tests but now can build will JDK 8 through to 18