visual studio - Could not get unknown property 'libs' for configuration container - Stack Overflow

I am new to gradle andtrying to update gradle version from 6.8.3 to 8.6. In the buil.gradle file, in

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"
         )        
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744757858a4591988.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信