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'
}
gradle加载spring包的更多相关文章
- maven加载spring包
<dependencies> <dependency> <groupId>org.springframework</groupId> <artif ...
- spring加载jar包中多个配置文件(转)
转自:http://evan0625.iteye.com/blog/1598366 在使用spring加载jar包中的配置文件时,不支持通配符,需要一个一个引入,如下所示: Java代码 <co ...
- 【Spring】Junit加载Spring容器作单元测试
如果我们需要对我们的Service方法作单元测试,恰好又是用Spring作为IOC容器的,我们可以这么配置Junit加载Spring容器,方便做单元测试. > 基本的搭建 (1)引入所需的包 & ...
- 【Spring】Junit加载Spring容器作单元测试(整理)
[Spring]Junit加载Spring容器作单元测试 阅读目录 >引入相关Jar包 > 配置文件加载方式 > 原始的用法 > 常见的用法 > 引入相关Jar包 一.均 ...
- ssh整合思想初步 struts2与Spring的整合 struts2-spring-plugin-2.3.4.1.jar下载地址 自动加载Spring中的XML配置文件 Struts2下载地址
首先需要JAR包 Spring整合Structs2的JAR包 struts2-spring-plugin-2.3.4.1.jar 下载地址 链接: https://pan.baidu.com/s/1o ...
- Junit加载Spring容器作单元测试
阅读目录 > 基本的搭建 > 常见的用法 如果我们需要对我们的Service方法作单元测试,恰好又是用Spring作为IOC容器的,我们可以这么配置Junit加载Spring容器,方便做单 ...
- Tomcat是如何加载Spring和SpringMVC及Servlet相关知识
概述 大家是否清楚,Tomcat是如何加载Spring和SpringMVC,今天我们就弄清下这个过程(记录最关键的东西) 其中会涉及到大大小小的知识,包括加载时候的设计模式,Servlet知识等,看了 ...
- 解决IDEA中Maven加载依赖包慢的问题
原理:maven加载jar包过程,默认的是先扫描本地仓库,若本地仓库没有,则扫描远程仓库下载.默认的conf/settings.xml文件没有配置远程仓库,所以扫描的是maven的中央仓库(在国外), ...
- JAVA动态加载JAR包的实现
如何动态的加载这些驱动!不可能把所有的数据库驱动都集成到JAR包中吧?!于是动态加载驱动的JAR包就产生了!其实这些在做系统基础代码时,经常用到,只是一般我们没有机会去搞而已. 动态加载JAR包,使用 ...
随机推荐
- Json数组操作小记 及 JSON对象和字符串之间的相互转换
[{"productid":"1","sortindex":"2"},{"productid":&q ...
- Java并发编程(五):Java线程安全性中的对象发布和逸出
发布(Publish)和逸出(Escape)这两个概念倒是第一次听说,不过它在实际当中却十分常见,这和Java并发编程的线程安全性就很大的关系. 什么是发布?简单来说就是提供一个对象的引用给作用域之外 ...
- Android Training - 使用IntentService运行任务(Lesson 2 - 发送任务给IntentService)
写在http://hukai.me/blog/android-training-18-running-background-service-lesson-2/
- Atitit .h5文件上传 v3
Atitit .h5文件上传 v3 1. 上传原理1 2. V3版新特性1 3. Html1 4. Js2 5. uploadV2.js2 6. upServlet & FileUploadS ...
- iOS7 SDK新特性
春风又绿加州岸.物是人非又一年.WWDC 2013 keynote落下帷幕,新的iOS开发旅程也由此开启.在iOS7界面重大变革的背后,开发人员们须要知道的又有哪些呢.同去年一样,我会先简单纵览地介绍 ...
- lua工具库penlight--06数据(二)
词法扫描 虽然 Lua 的字符串模式匹配是非常强大,但需要更强大的东西.pl.lexer.scan可以提供标记字符串,按标记机分类数字.字符串等. > lua -lpl Lua 5.1.4 C ...
- 架构探险——第三章(搭建轻量级Java Web框架)
解决的问题 servlet的数量会随业务功能的扩展而不断增加,我们有必要减少servlet的数量,交给controller处理,它负责调用service的相关方法,并将返回值放入request或res ...
- ES6快速入门使用
https://www.jianshu.com/p/061304806bda Babel-webpack的配置 Bebal官方文档 前段项目我想使用ES6的语法我应该怎么做呢?我们可以查看Babel的 ...
- python笔记4 - 函数
函数是组织好的,可重复使用的,用来实现单一,或相关联功能的代码段. 函数能提高应用的模块性,和代码的重复利用率.你已经知道Python提供了许多内建函数,比如print().但你也可以自己创建函数,这 ...
- 数组有没有length()这个方法?String有没有length()这个方法?
数组有没有length()这个方法?String有没有length()这个方法? 解答:数组没有length()方法 它有length属性 String有length()方法.