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. Javascript屏蔽鼠标的右键的两种方法。

    方法一:利用鼠标button的键值 <script language="javascript"> function blockright(oEvent) { var o ...

  2. redis(1)简介

    一.nosql简介 RDBMS(关系型数据库)提供的结构化编程,让数据建模以及应用程序编程变得非常简单,带来了非常高的经济效益,并且学习成本也比较低.但在当今数据大爆炸时代,每时每刻都会海量的数据产生 ...

  3. flask 服务器详解

    #!/usr/local/bin/python # coding=utf-8 from flask import Flask app = Flask(__name__) @app.route('/') ...

  4. 跨域解决方案之HTML5 postMessage

    问题场景: web是嵌入到手机客户端中的静态页面,为了统计用户行为需要引入ga,但是ga必须是在www下才行,哪怕是localhost,这就是矛盾.解决方案是在页面中使用iframe,iframe是在 ...

  5. COGS 有标号的二分图计数系列

    其实这三道题都是不错的……(虽然感觉第三题略套路了……) 分别写一下做法好了…… COGS2392 有标号的二分图计数 I 这个就很简单了,Noip难度. 显然可以直接认为黑点和白点分别位于二分图两侧 ...

  6. 纯css面板插件,自适应,多样式

    最近在做公司的系统后台,用的bootstrap,在设计布局的时候不喜欢他的面板,所以自己写了这个面板插件,分享给大家 先上预览图: 默认样式: 绿色: 黄色: 蓝: 红: 使用方法: 引用MoUi.c ...

  7. table中的td自动换行

    总有那么几个时候会觉得,table的td不能自适应换行真坑,凭什么只能用tr来换行,经常数据都是连在一起的呀,你叫我怎么把它拆分放到tr里...... 那能不能用ul和li来替换?可以是可以,不过有时 ...

  8. VS2013 C++ 动态链接库的生成

    原文:http://www.cnblogs.com/djiankuo/p/5092025.html 这个东西搞了好几天,现在终于没有问题了,其实现在想来还是微软做的东西好用啊,在这里点个赞!!! LL ...

  9. 【Python】卸载完Python3 之后 Python2 无法打开IDLE

    安装官方的Python带Idle但是却无法打开,百度谷歌了几种解决方法,加上自己的实际境况予以解决. 我的python是直接安装在C盘下的. 1.首先是设置环境变量: Path=C:\Python27 ...

  10. 实验一:使用符号执行工具klee对软件进行破解(来自于klee官网)

    原文地址:https://gitlab.com/Manouchehri/Matryoshka-Stage-2/blob/master/stage2.md 实验用代码下载地址:https://gitla ...