Gradle equivalent of maven-dependency-plugin

谁说胖子不能爱 提交于 2019-12-03 12:28:45

Here is how I solved this problem (the same as in maven actually):

Add another configuration for dependencies:

configurations{ 
     taglibs { transitive = false }
}

Add needed dependency to this configuration:

dependencies {
    ...
    taglibs "org.springframework.security:spring-security-taglibs:$springSecurityVersion"
    ...
}

Add gradle code to copy these dependencies to required folder:

task copytaglibs << { 
   copy { 
      from configurations.taglibs
      into 'src/main/webapp/WEB-INF/lib'
   }
} 

compileTestJava{
   dependsOn copytaglibs
}

This is it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!