---
title: "初识gradle"
author: "zhb8015"
date: "2015-06-04T14:07:13Z"
tags: []
categories: ["非技术"]
slug: "gradle"
draft: false
lastmod: "2015-06-04T14:19:27Z"
id: 2217004
url: "https://peter8015.iteye.com/blog/2217004"
---

**Concept**

         Gradle 是以 Groovy 语言为基础，面向[Java](http://baike.baidu.com/view/29.htm)应用为主。基于DSL（领域特定语言）语法的自动化构建工具。

 

    **Script**

         编写gradle脚本下载Spring4的依赖：

 

         **build.gradle**

```
apply plugin: 'java'

repositories {
	mavenCentral()
}

dependencies {
	compile 'org.springframework:spring-context:4.1.6.RELEASE'
}

task copyJars(type:Copy) {
	from configurations.runtime
	into 'libs'
}
```

 

     **Run**

          gradle build