Hi
I am trying to upgrade Gradle project with Gradle 7.3 and Java 17.
getting "Failed to apply plugin class ‘org.springframework.boot.gradle.plugin.SpringBootPlugin’.
Configuration with name ‘runtime’ not found." error message while building.
Any help is appreciated. Below is my “build.gradle” file.
buildscript {
repositories {
maven { url "https://mvnrepository.com/"
metadataSources {
mavenPom()
artifact()
}}
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.7.2"
}
}
version “0.1”
group “pop.web.v2”
configurations {
compile
deploy
libsDomain
libMbeanTypes
testCompile {
extendsFrom compile
}
clover {
extendsFrom testCompile
}
}
apply plugin:“idea”
apply plugin:“war”
apply plugin:“org.grails.grails-web”
apply plugin:“asset-pipeline”
apply plugin:“org.grails.grails-gsp”
apply from: ‘coreDependencies.gradle’
apply from: ‘commonsDependencies.gradle’
apply from: ‘dependencies.gradle’
apply from: ‘deploy.gradle’
sourceCompatibility = 17
targetCompatibility = 17
version = getCustomVersion()
dependencyManagement {
imports {
mavenBom “org.grails:grails-bom:$grailsVersion”
mavenBom “org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}”
}
applyMavenExclusions false
}
dependencies {
compile “org.owasp.esapi:esapi:2.2.0.0”
testCompile "org.grails:grails-test-mixins:3.3.0"
}
sourceSets {
main {
if(System.getenv()['CI_JOB_ID'] == null){
resources {
srcDirs = srcDirs + ["configuration/properties"]
}
}
}
}
bootRun {
doFirst{
//The main build directories aren’t collected so they are added manually
FileCollection collection = files(“${project.buildDir}/classes/main”) + files(“${project.buildDir}/resources/main”) + files(launcherJar.archivePath)
classpath = collection
}
jvmArgs(‘-Dspring.output.ansi.enabled=always’)
addResources = true
String springProfilesActive = ‘spring.profiles.active’
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(Test) {
systemProperty “geb.env”, System.getProperty(‘geb.env’)
systemProperty “geb.build.reportsDir”, reporting.file(“geb/integrationTest”)
systemProperty “webdriver.chrome.driver”, System.getProperty(‘webdriver.chrome.driver’)
systemProperty “webdriver.gecko.driver”, System.getProperty(‘webdriver.gecko.driver’)
}
assets {
minifyJs = false
minifyCss = false
}
task launcherJar(type: Jar) {
def gradleUserHome = new File(gradle.getGradleUserHomeDir(), “caches”)
def relativeClasspathEntries = configurations.runtime.files.collect {
new File(gradleUserHome.getAbsolutePath()).toURI().
relativize(new File(it.getAbsolutePath()).toURI()).getPath()
}
appendix = "launcher"
destinationDir = gradleUserHome
doFirst {
manifest {
attributes "Class-Path": relativeClasspathEntries.join(" ")
}
}
}
compileGroovy{
dependsOn launcherJar
FileCollection collection = files(launcherJar.archivePath);
def finCollection = collection
doLast {
classpath = finCollection
}
}
war{
manifest {
attributes ‘Version’: version
}
}
def getCustomVersion() {
if(System.getenv()[‘BUILD_ID’] != null){
String customVersion = “1.0.0-” + new Date().format(‘yyyyMMddHHmmss’)
if(System.getenv()[‘BUILD’] == ‘true’){
println “################################”
println customVersion
println “################################”
}
return customVersion
} else {
return “1.0.0”
}
}