zoukankan      html  css  js  c++  java
  • 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'
    }
    

      

  • 相关阅读:
    IDEA04 工具窗口管理、各种跳转、高效定位、行操作、列操作、live template、postfix、alt enter、重构、git使用
    Maven01 环境准备、maven项目结构、编译/测试/打包/清除、安装、
    SpringBoot31 整合SpringJDBC、整合MyBatis、利用AOP实现多数据源
    Docker03 Docker基础知识、Docker实战
    [leetcode数组系列]2三数之和
    [leetcode数组系列]1 两数之和
    时间复杂度总结
    《将博客搬至CSDN》
    5 系统的软中断CPU升高,一般处理办法?
    python数据分析5 数据转换
  • 原文地址:https://www.cnblogs.com/JAYIT/p/6889562.html
Copyright © 2011-2022 走看看