I am new to gradle and trying to update gradle version from 6.8.3 to 8.6. In the buil.gradle file, in one of my projects I want to copy some files from libs to WEB-INF/lib directory but I get this error:
Could not get unknown property 'libs' for configuration container of type .gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.
So, my question is how could I find which Jar files should be copied in that directory and what is the problem with libs because the build is working perfectly with gradle version 6.8.3.
When I change the configurations.libs.files to configurations.classPath the build works fine but the files copied in the lib folder is more than the numbers than I expected. I am using visual studio and expect some one can help me. I am also new to programming.
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'war'
id 'java-library'
id 'maven-publish'
}
configurations{
libs
}
dependencies {
// Global dependencies
providedCompile '.apache.logging.log4j:log4j-slf4j2-impl:2.24.3'
providedCompile '.junit.jupiter:junit-jupiter:5.10.2'
....
}
task libs{
dependsOn "clean"
mkdir("${build_war}/WEB-INF/lib")
copy{
from configurations.libs.files
into build_war+"/WEB-INF/lib"
}
ant.copy(
todir: "${build_war}/WEB-INF/lib",
overwrite: 'true',
file: "${gwt_sdk}/gwt-servlet.jar"
)
ant.copy(
todir: "${build_war}/WEB-INF/lib",
overwrite: 'true',
file: "${gwt_sdk}/gwt-servlet-deps.jar"
)
}