最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论