《一gradle创建SSM项目——依赖包》

build.gradle

compile:编译时必须.
runtime:运行时必须,包括编译时。
testCompile:测试编译时必须。
testRuntime:测试运行时必须,包括编译时。
注:此外配置依赖包,还可以模块化配置、导入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的增强版)
    compile "com.baomidou:mybatis-plus:2.1.4"
    compile group: 'org.apache.velocity', name: 'velocity', version: '1.7'

    //MySQL数据库驱动
    compile "mysql:mysql-connector-java:5.1.23"

    //阿里巴巴 数据库连接池
    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文档 自动生成
    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标签库
    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(切点表达式)
    compile "org.aspectj:aspectjrt:1.7.4"
    compile "org.aspectj:aspectjweaver:1.7.4"
}

最后附一张build.gradle截图

《一gradle创建SSM项目——依赖包》_第1张图片
上传图片edge不行!要用chrome!

你可能感兴趣的:(《一gradle创建SSM项目——依赖包》)