Gradle入门实战(Windows版)
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:
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版)的更多相关文章
- ALCHEMY 2 (FLASCC)新手入门 (WINDOWS 版)
Adobe Alchemy(炼金术) 2的预发布版本已经对开发者开放,并且已经更名为 FlasCC.炼金术简单来说就是把c/c 代码编译成swf文件,它吸收了c/c 高效的执行效率,比传统开发的swf ...
- Ruby入门--Linux/Windows下的安装、代码开发及Rails实战
Ruby入门--Linux/Windows下的安装.代码开发及Rails实战 http://www.linuxidc.com/Linux/2014-04/100242.htm Ubuntu 13.04 ...
- Android Studio2.0 教程从入门到精通Windows版 - 入门篇
http://www.open-open.com/lib/view/open1468121363300.html 本文转自:深度开源(open-open.com)原文标题:Android Studio ...
- Docker技术入门与实战 第二版-学习笔记-10-Docker Machine 项目-2-driver
1>使用的driver 1〉generic 使用带有SSH的现有VM/主机创建机器. 如果你使用的是机器不直接支持的provider,或者希望导入现有主机以允许Docker Machine进行管 ...
- Android Studio2.0 教程从入门到精通Windows版
系列教程 Android Studio2.0 教程从入门到精通Windows版 - 安装篇Android Studio2.0 教程从入门到精通Windows版 - 入门篇Android Studio2 ...
- Docker技术入门与实战 第二版-学习笔记-8-网络功能network-3-容器访问控制和自定义网桥
1)容器访问控制 容器的访问控制,主要通过 Linux 上的 iptables防火墙来进行管理和实现. iptables是 Linux 上默认的防火墙软件,在大部分发行版中都自带. 容器访问外部网络 ...
- 移动端自动化测试Appium 从入门到项目实战Python版☝☝☝
移动端自动化测试Appium 从入门到项目实战Python版 (一个人学习或许会很枯燥,但是寻找更多志同道合的朋友一起,学习将会变得更加有意义✌✌) 说到APP自动化测试,Appium可是说是非常流 ...
- 移动端自动化测试appium 从入门到项目实战Python版✍✍✍
移动端自动化测试appium 从入门到项目实战Python版 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课程 ...
- 移动端自动化测试Appium 从入门到项目实战Python版
移动端自动化测试Appium 从入门到项目实战Python版 整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感受,单论单个知识点课 ...
随机推荐
- 001.開始使用ASP.NET Web API 2(一)
原文鏈接:http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web ...
- spring整合struts2和hibernate
1.spring 1.1 jar包 1.2 spring.xml <?xml version="1.0" encoding="UTF-8"?> &l ...
- webpack使用extract-text-webpack-plugin打包时提示错误Use Chunks.groupsIterable and filter by instanceof Entryp
转自:https://blog.csdn.net/gezilan/article/details/80020417 前提条件: 当前时间是2018年4月20日. webpack的最新版本为是 v4.6 ...
- [javaEE] 数据库连接池和动态代理
实现javax.sql.DataSource接口 实现Connection getConnection()方法 定义一个静态的成员属性LinkedList类型作为连接池,在静态代码块中初始化5条数据库 ...
- JS的Object类的属性、方法及如何创建对象
属性 constructor:对创建对象的函数的引用(指针).对于Object类,该指针指向原始的object()函数. prototype:对该对象的对象原型的引用.对于所有的类,它默认返回Obje ...
- Springmvc file多附件上传 显示 删除操作
之前项目需求要做一个多附件上传 并显示上传文件 带删除操作 一筹莫展之际搜到某个兄弟发的博客感觉非常好用被我copy下来了此贴算是改良版 再次感谢(忘记叫什么了时间也有点久没有历史记录了)先上图 基于 ...
- 七 FileChannel
FileChannel是一个连接到文件的通道,可以通过文件通道读写文件 FileChannel无法设置为非阻塞模式,它总是运行在阻塞模式下. 打开FileChannel 在使用FileChannel之 ...
- 重构指南 - 封装条件(Encapsulate Conditional)
封装就是将相关的方法或者属性抽象成为一个对象. 封装的意义: 对外隐藏内部实现,接口不变,内部实现自由修改. 只返回需要的数据和方法. 提供一种方式防止数据被修改. 更好的代码复用. 当代码中包含 ...
- Object.preventExtensions()使用技巧
Object.preventExtensions() 方法让一个对象变的不可扩展,也就是永远不能再添加新的属性. // Object.preventExtensions将原对象变的不可扩展,并且返回原 ...
- Csharp: speech to text, text to speech in win
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...