《一gradle創(chuàng)建SSM項(xiàng)目——依賴包》

build.gradle

compile:編譯時(shí)必須.
runtime:運(yùn)行時(shí)必須,包括編譯時(shí)。
testCompile:測(cè)試編譯時(shí)必須。
testRuntime:測(cè)試運(yùn)行時(shí)必須,包括編譯時(shí)。
注:此外配置依賴包,還可以模塊化配置、導(dǎo)入list、配置是否傳遞等。

spring_version = "4.1.6.RELEASE"

{
    //springmvc + Spring Configuration
    compile "org.springframework:spring-web:$spring_version"
    compile "org.springframework:spring-webmvc:$spring_version"
    compile "org.springframework:spring-aop:$spring_version"
    compile "org.springframework:spring-aspects:$spring_version"
    compile "org.springframework:spring-beans:$spring_version"
    compile "org.springframework:spring-context:$spring_version"
    compile "org.springframework:spring-context-support:$spring_version"
    compile "org.springframework:spring-core:$spring_version"
    compile "org.springframework:spring-expression:$spring_version"
    compile "org.springframework:spring-jdbc:$spring_version"
    compile "org.springframework:spring-messaging:$spring_version"
    compile "org.springframework:spring-orm:$spring_version"
    compile "org.springframework:spring-tx:$spring_version"
    compile "org.springframework:spring-test:$spring_version"

    //MyBatis-plus (mybatis的增強(qiáng)版)
    compile "com.baomidou:mybatis-plus:2.1.4"
    compile group: 'org.apache.velocity', name: 'velocity', version: '1.7'

    //MySQL數(shù)據(jù)庫(kù)驅(qū)動(dòng)
    compile "mysql:mysql-connector-java:5.1.23"

    //阿里巴巴 數(shù)據(jù)庫(kù)連接池
    compile "com.alibaba:druid:1.0.12"

    //json解析
    compile "com.google.code.gson:gson:2.7"

    //fastjson springmvc 用他來為@ ResponseBody 注解的方法 , 返回 json
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jackson_version
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jackson_version

    //日志文件管理包log4j
    compile group: 'log4j', name: 'log4j', version: '1.2.17'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.24'
    compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.24'

    //api文檔 自動(dòng)生成
    compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0'
    compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0'

    //servlet依賴
    compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
    compile group: 'javax.servlet', name: 'jsp-api', version: '2.0'

    //jstl標(biāo)簽庫(kù)
    compile "taglibs:standard:1.1.2"
    compile "javax.servlet:jstl:1.2"

    //公共資源包
    compile "commons-logging:commons-logging:1.2"
    compile "commons-lang:commons-lang:2.6"
    compile "org.apache.commons:commons-collections4:4.0"
    compile "commons-beanutils:commons-beanutils:1.8.3"
    compile "commons-dbcp:commons-dbcp:1.4"
    compile "commons-pool:commons-pool:1.6"

    //文件上傳
    compile "commons-fileupload:commons-fileupload:1.3.1"
    compile "commons-io:commons-io:2.4"

    //AspectJ(切點(diǎn)表達(dá)式)
    compile "org.aspectj:aspectjrt:1.7.4"
    compile "org.aspectj:aspectjweaver:1.7.4"
}

最后附一張build.gradle截圖

上傳圖片edge不行!要用chrome!
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容