gradle加载spring包

import org.gradle.plugins.ide.eclipse.model.Facet
   
apply plugin: 'java'
apply plugin: 'war' apply plugin: 'eclipse' apply plugin: 'eclipse-wtp' sourceCompatibility = 1.7 // 设置 JDK 版本 webAppDirName = 'WebContent' // 设置 WebApp 根目录 sourceSets.main.java.srcDir 'src/main/java' // 设置 Java 源码所在目录 // 设置 maven 库地址 repositories { mavenCentral() // 中央库 } // 设置依赖 dependencies { providedCompile 'javax.servlet:servlet-api:2.5' // 编译期 providedRuntime 'javax.servlet:jstl:1.2' // 运行时 compile 'org.springframework:spring-context:4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-core', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-beans', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-context', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-web', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-aop', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-tx', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-jdbc', version: '4.3.8.RELEASE' compile group: 'org.springframework', name: 'spring-test', version: '4.3.8.RELEASE' compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.11.3.RELEASE' } // 设置 Project Facets eclipse { wtp { facet { facet name: 'jst.web', type: Facet.FacetType.fixed facet name: 'wst.jsdt.web', type: Facet.FacetType.fixed facet name: 'jst.java', type: Facet.FacetType.fixed facet name: 'jst.web', version: '3.1' facet name: 'jst.java', version: '1.7' facet name: 'wst.jsdt.web', version: '1.0' } } }

设置spring 版本

dependencies {
    // 设置依赖
    def springVersion='4.3.8.RELEASE'
    dependencies {
        providedCompile 'javax.servlet:servlet-api:2.5' // 编译期
        providedRuntime 'javax.servlet:jstl:1.2'    // 运行时
        compile 'org.springframework:spring-context:$springVersion'
        compile group: 'org.springframework', name: 'spring-core', version:'$springVersion'
        compile(
                'org.springframework:spring-beans: $springVersion',
                'org.springframework:spring-context-support:$springVersion',
                'org.springframework:spring-web:$springVersion',
                'org.springframework:spring-webmvc:$springVersion',
                'org.springframework:spring-aop:$springVersion',
                'org.springframework:spring-tx:$springVersion',
                'org.springframework:spring-jdbc:$springVersion',
                'org.springframework:spring-test:$springVersion',
                'org.springframework:spring-context:$springVersion'
        )

        compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.11.3.RELEASE'

    }
    testCompile group: 'junit', name: 'junit', version: '4.11'
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

  

 

转载于:https://www.cnblogs.com/JAYIT/p/6889562.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值