Installation

Gradle runs on all major operating systems and requires only a Java JDK or JRE version 7 or higher to be installed. To check, run java -version:

$ java -version
java version "1.8.0_121"

Step 1. Download the latest Gradle distribution

download url : https://gradle.org/releases/ 
提供了二进制包和完整包(包含User Manual、API Javadoc、DSL Reference)

Step 2. Unpack the distribution

Create a new directory C:\Gradle with File Explorer.

Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-4.1 to your newly created C:\Gradle folder.

Alternatively(另外) you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.

Step 3. Configure your system environment

In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System Settings -> Environmental Variables.

Under System Variables select Path, then click Edit. Add an entry for C:\Gradle\gradle-4.1\bin. Click OK to save.

Step 4. Verify your installation

Open Windows command prompt and run gradle -v to run gradle and display the version, 
e.g.:

$ gradle -v
Gradle 4.1

注意:不同窗口下命令的执行 
dos: C:\Users\14009\Desktop\basic-demo>gradlew properties 
gitbash: $ ./gradlew properties

Building Java Applications

$ mkdir java-demo
$ cd java-demo
$ gradle init --type java-application

build.gradle 中添加 apply plugin: ‘idea’ 
执行命令 gradle idea 
用 IntelliJ IDEA打开就可以开始编码

Building Java Libraries

$ mkdir building-java-libraries
$ cd building-java-libraries
$ gradle init --type java-library

Building Java Web Applications

1.0  Create the structure of a web application

create the following file structure for a project called webdemo:

 Sample project layout
webdemo/
src/
main/
java/
webapp/
test
java/

2.0  Add a Gradle build file

Add a file called build.gradle to the root of the project, with the following contents:

build.gradle

plugins {
id 'java'
id 'war'
} repositories {
jcenter()
} dependencies {
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
testCompile 'junit:junit:4.12'
}

It is a good practice to generate a Gradle wrapper for the project by executing the wrapper task:

$ gradle wrapper --gradle-version=4.0

Gradle入门实战(Windows版)的更多相关文章

  1. ALCHEMY 2 (FLASCC)新手入门 (WINDOWS 版)

    Adobe Alchemy(炼金术) 2的预发布版本已经对开发者开放,并且已经更名为 FlasCC.炼金术简单来说就是把c/c 代码编译成swf文件,它吸收了c/c 高效的执行效率,比传统开发的swf ...

  2. Ruby入门--Linux/Windows下的安装、代码开发及Rails实战

    Ruby入门--Linux/Windows下的安装.代码开发及Rails实战 http://www.linuxidc.com/Linux/2014-04/100242.htm Ubuntu 13.04 ...

  3. Android Studio2.0 教程从入门到精通Windows版 - 入门篇

    http://www.open-open.com/lib/view/open1468121363300.html 本文转自:深度开源(open-open.com)原文标题:Android Studio ...

  4. Docker技术入门与实战 第二版-学习笔记-10-Docker Machine 项目-2-driver

    1>使用的driver 1〉generic 使用带有SSH的现有VM/主机创建机器. 如果你使用的是机器不直接支持的provider,或者希望导入现有主机以允许Docker Machine进行管 ...

  5. Android Studio2.0 教程从入门到精通Windows版

    系列教程 Android Studio2.0 教程从入门到精通Windows版 - 安装篇Android Studio2.0 教程从入门到精通Windows版 - 入门篇Android Studio2 ...

  6. Docker技术入门与实战 第二版-学习笔记-8-网络功能network-3-容器访问控制和自定义网桥

    1)容器访问控制 容器的访问控制,主要通过 Linux 上的 iptables防火墙来进行管理和实现. iptables是 Linux 上默认的防火墙软件,在大部分发行版中都自带. 容器访问外部网络 ...

  7. 移动端自动化测试Appium 从入门到项目实战Python版☝☝☝

    移动端自动化测试Appium 从入门到项目实战Python版 (一个人学习或许会很枯燥,但是寻找更多志同道合的朋友一起,学习将会变得更加有意义✌✌)  说到APP自动化测试,Appium可是说是非常流 ...

  8. 移动端自动化测试appium 从入门到项目实战Python版✍✍✍

    移动端自动化测试appium 从入门到项目实战Python版 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程 ...

  9. 移动端自动化测试Appium 从入门到项目实战Python版

    移动端自动化测试Appium 从入门到项目实战Python版  整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课 ...

随机推荐

  1. url字符转义

    作者在做短链接功能时,url参数里带了&字符,结果无法转换.后来查了一下,发现可以用其它符号代替.下面是对应表 +    URL 中+号表示空格                         ...

  2. sublime快捷键大全(转)

    文件 File 新建文件 Ctrl + N 打开文件 Ctrl + O 打开最近关闭的文件 Ctrl + Shift + T 保存 Ctrl + S 另存为… Ctrl + Shift + S 关闭文 ...

  3. rabbit的fanout扇形交换机

    rabbit引入交换机概念. 交换机与生产者绑定. 队列与消费者绑定. 队列又与交换机绑定. 扇形交换机是  fanout类型的. 类似于其他消息中间件的 topic.一对多(生产者推送消息到指定交换 ...

  4. spring 学习总结(一)

    一.spring概述 1.spring 是什么? Spring是一个开放源代码的设计层面框架,他解决的是业务逻辑层和其他各层的松耦合问题,因此它将面向接口的编程思想贯穿整个系统应用.Spring是于2 ...

  5. 【原创】MapReduce程序如何在集群上执行

    首先了解下资源调度管理框架Yarn. Yarn的结构(如图): Resource Manager (rm)负责调度管理整个集群上的资源,而每一个计算节点上都会有一个Node Manager(nm)来负 ...

  6. Windows Server 2008 R2 搭建网站详细教程

    转自:http://jingyan.baidu.com/album/642c9d34098bf5644a46f71f.html?picindex=4 网上都有一些Windows Server 2008 ...

  7. java TreeSet 实现存自定义不可重复数据

    本文主要是介绍一下java集合中的比较重要的Set接口下的可实现类TreeSet TreeSet类,底层用二叉树的数据结构 * 集合中以有序的方式插入和抽取元素. * 添加到TreeSet中的元素必须 ...

  8. StringBuffer总结分析

    构造方法 /** * Constructs a string buffer with no characters in it and an * initial capacity of 16 chara ...

  9. strcmp和stricmp、strcmpi三者之间的区别(C++)

    原文:http://www.cnblogs.com/tankeee/p/3957629.html #include <string.h> #include <stdio.h> ...

  10. 【Supervised Learning】支持向量机SVM (to explain Support Vector Machines (SVM) like I am a 5 year old )

    Support Vector Machines 引言 内核方法是模式分析中非常有用的算法,其中最著名的一个是支持向量机SVM 工程师在于合理使用你所拥有的toolkit 相关代码 sklearn-SV ...