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. DBUtils工具类的使用

    DBUtils工具类1.DBUtils工具类,由apache组织提供的工具类,对JDBC做了一些简单封装. 做了查询的封装,把查询的结果封装到List集合 Map集合 JavaBean对象中 做了增删 ...

  2. java java-web linux C C++ 安装系统 数据结构 算法 教程分享

    qq1206630874 v18455730857 免费分享

  3. Hbuilder编辑App时,ajax跨域访问失败问题

    今天试着用Hbuilder写app的前段显示页面,在第一步时就被打住了,ajax异步调用服务器的登录接口时,报错, 显示这样的错误 XMLHttpRequest cannot loadhttp://w ...

  4. WES7 定制界面完整过程(去除所有windows标识)

    转载但有改动 红色字体记录 目的:实验从启动开始到出现桌面,不出现任何windows图标或标识.重大提示:在某些虚拟机上面操作和真实机器是不一样的,主机会容易很多;所以在虚拟机无法实现效果的时候使用主 ...

  5. datatable 转字符串

    --select stuff ((SELECT ','+bu from DT_SalesBooking group by bu for xml path('')),1,1,'')--select st ...

  6. fabu dao fenleizhong

    IsAggregated IsAggregatedIsAggregated IsAggregatedIsAggregated IsAggregatedIsAggregated IsAggregated ...

  7. java 并发(三)---Thread 线程

    Thread 的状态 线程共有五种状态.分别是: (1)新建 (2)就绪 (3)运行 (4)阻塞 (5)死亡 ,下面列列举的状态需要结合状态示意图更好理解.  新建状态(New): 新创建了一个线程对 ...

  8. 一个Json、数组、Dictionary转换和数组对比的C#实例

    最近做了一个程序,里面一段代码用到Json.数组.Dictionary转换和数组对比的一些知识,虽然在实际碰到类似问题时候有更好的方法,但这就当是一次基础知识的回顾,现在分享一下. 先介绍下要实现的业 ...

  9. sqlserver2008数据库文件降级为sqlserver2005文件

    直接分离附加是不行的. 操作步骤如下: 在sqlserver2008企业管理器中 右键xx数据库->任务->生成脚本 弹出框中勾选 为所选数据库中的所有对象编写脚本 下一步  修改如下图片 ...

  10. orcale数据恢复

    在操作数据时,不小心改错了表中的数据,想恢复到之前的数据,则可用以下方法: 1.首先我们需要通过dbms_flashback.get_system_change_number,它可以获取系统当前的SC ...