码迷,mamicode.com
首页 > 其他好文 > 详细

gradle基础的build文件模板

时间:2016-11-11 19:53:46      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:set   服务   target   cond   version   main   版本号   tag   ati   

group ‘组织名‘
version ‘版本号‘

/* 支持的插件 */ apply plugin:
‘java‘ apply plugin: ‘war‘ apply plugin: ‘eclipse‘ apply plugin: ‘eclipse-wtp‘ apply plugin: ‘idea‘ apply plugin: ‘jetty‘ // 使用jetty作为服务器 sourceCompatibility = 1.6 // jdk版本 targetCompatibility = 1.6 sourceSets.main.output.classesDir = file("bin") // 为了配合eclipse而定义的文件结构 repositories { maven { url "http://maven.aliyun.com/nexus/content/groups/public/" // 这个仓库好,下载jar速度超级快 } mavenLocal() mavenCentral() flatDir name: ‘localRepository‘, dirs: ‘lib‘ }
// 综合版本控制 project.ext { springVersion
= ‘4.3.2.RELEASE‘ /* 框架版本控制 */ aspectjVersion = ‘1.8.9‘ jacksonVersion = ‘2.8.4‘ } dependencies { providedCompile ( // 为了eclipse能正常编译 ‘javax.servlet:servlet-api:3.0-alpha-1‘, ‘tomcat:servlet:4.1.36‘, ‘javax.servlet:jstl:1.1.2‘, ‘taglibs:standard:1.1.2‘ /* JSP的扩展标记库 */ ) compile ( ‘com.google.guava:guava:20.0‘, ‘org.springframework:spring-web:‘ + springVersion, ‘org.springframework:spring-webmvc:‘ + springVersion, ‘org.springframework:spring-aop:‘ + springVersion runtime ( ‘org.slf4j:slf4j-log4j12:1.7.5‘, ‘log4j:log4j:1.2.17‘ ) testCompile ( ‘junit:junit:4.4‘, ‘org.springframework:spring-test:‘ + springVersion ) } jettyRunWar.contextPath = ‘‘ /* jettyRun 的配置 */ jettyRun { httpPort = 8080 reload = "automatic" scanIntervalSeconds = 1 contextPath = ‘项目名或者为空ROOT‘ } task wrapper(type: Wrapper) { gradleVersion = ‘2.14.1‘ // gradle的版本选择 }

 

gradle基础的build文件模板

标签:set   服务   target   cond   version   main   版本号   tag   ati   

原文地址:http://www.cnblogs.com/SummerinShire/p/6055151.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!