I’m updating a below old project gradle files (5.5.1) to use gradle 8.5. Replaced ‘compile’ with ‘implementation’ and getting below error.
Resolving dependency configuration ‘implementation’ is not allowed as it is defined as ‘canBeResolved=false’.
Instead, a resolvable (‘canBeResolved=true’) dependency configuration that extends ‘implementation’ should be resolved.
I’m sure I’ve really messed up something. appreciate your help!
project/build.gradle
allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
repositories {
mavenCentral()
}
configurations {
provided
compile.extendsFrom provided
}
dependencies {
provided files('../../lib/spring-aop-5.3.20.jar')
provided files('../../lib/spring-aspects-5.3.20.jar')
...
testCompile 'junit:junit:4.12'
}
}
project/common/build.gradle
dependencies {
compile files('../../lib/commons-dbcp-1.4.jar')
compile files('../../lib/commons-pool-1.5.6.jar')
compile files('../../lib/spring-aop-5.3.20.jar')
compile files('../../lib/spring-aspects-5.3.20.jar')
}
jar {
baseName = 'common'
mkdir "dist"
doLast {
copy {
from('build/libs')
into('dist')
}
}
}
task cleanDir(type: Delete) {
delete 'dist'
}
tasks.clean.doLast() {
tasks.cleanDir.execute()
}
project/abcws/build.gradle
dependencies {
compile project(':common')
}
jar {
baseName = 'abcws'
from((configurations.compile - configurations.provided).collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
manifest {
attributes 'Implementation-Title': 'Test',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Class-Path': './'
}
mkdir "dist"
doLast {
copy {
from('build/libs')
into('dist')
}
}
}
task cleanDir(type: Delete) {
delete 'dist'
}
tasks.clean.doLast() {
tasks.cleanDir.execute()
}