Gradle War 插件


当前第2页 返回上一页

war 插件的自定义

build.gradle

configurations {
   moreLibs
}
repositories {
   flatDir { dirs "lib" }
   mavenCentral()
}
dependencies {
    compile module(":compile:1.0") {
        dependency ":compile-transitive-1.0@jar"
        dependency ":providedCompile-transitive:1.0@jar"
    }
    providedCompile "javax.servlet:servlet-api:2.5"
    providedCompile module(":providedCompile:1.0") {
        dependency ":providedCompile-transitive:1.0@jar"
    }
    runtime ":runtime:1.0"
    providedRuntime ":providedRuntime:1.0@jar"
    testCompile 'junit:junit:4.11'
}
    moreLibs ":otherLib:1.0"
}
war {
    from 'src/rootContent' // adds a file-set to the root of the archive
    webInf { from 'src/additionalWebInf' } // adds a file-set to the WEB-INF dir.
    classpath fileTree('additionalLibs') // adds a file-set to the WEB-INF/lib dir.
    classpath configurations.moreLibs // adds a configuration to the WEB-INF/lib dir.
    webXml = file('src/someWeb.xml') // copies a file to WEB-INF/web.xml
}  

当然,你可以用一个定义了 excludes 和 includes 的闭包来配置不同的文件集。


标签:Gradle

返回前面的内容

相关阅读 >>

Gradle ear 插件

Gradle war 插件

Gradle sonar runner 插件

Gradle 安装

Gradle java 插件

Gradle java 构建入门

Gradle 任务详述

Gradle 日志

Gradle 使用文件

Gradle codenarc 插件

更多相关阅读请进入《Gradle》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...