providedCompile without war plugin

后端 未结 7 1717
忘掉有多难
忘掉有多难 2020-12-23 10:00

I want to reuse certain filter for many projects so I want to extract it and use a single jar to just add it to any Web App.

For building I am using Gradle 1.3 and t

7条回答
  •  攒了一身酷
    2020-12-23 10:19

    There is an easier way:

    configurations {    
        provided
        provided.extendsFrom(compile)
    }
    

    and then you can:

    dependencies {  
        provided group: 'javax.servlet', name: 'javax.servlet-api', version:'3.+' 
    }
    

    You will also want to have the provided libraries in the generated project files of Eclipse or Idea:

    idea.module.scopes.PROVIDED.plus += configurations.provided
    eclipse.classpath.plusConfigurations += configurations.provided
    

提交回复
热议问题