Gradle的安装

gradle

Gradle是一个基于Apache Ant和Apache Maven概念的项目自动化构建开源工具。它使用一种基于Groovy的特定领域语言(DSL)来声明项目设置,抛弃了基于XML的各种繁琐配置。
面向Java应用为主。当前其支持的语言限于Java、Groovy、Kotlin和Scala,计划未来将支持更多的语言。

官网

可以选择在线安装或者手动安装
支持 mac、linux 和 windows
需要安装 jdk 1.7 以及以上环境-如果你选择最新版的需要 jdk1.8 及以上
gradle 官网

手动安装gradle

手动安装直接参考 https://gradle.org/install/#manually
可以在线安装,有兴趣看官网吧

Step 1. Download the latest Gradle distribution

有两个版本
Binary-only
Complete, with docs and sources

Step 2. Unpack the distribution

Linux & MacOS users
Unzip the distribution zip file in the directory of your choosing, e.g.:
$ mkdir /opt/gradle
$ unzip -d /opt/gradle gradle-5.2.1-bin.zip
$ ls /opt/gradle/gradle-5.2.1
LICENSE NOTICE bin getting-started.html init.d lib media
Microsoft Windows users
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-5.2.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

Linux & MacOS users
Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:

vim ~/.bash_profile
source ~/.bash_profile
gradle -v

注意, path 包含其他,则 path 的相关声明需要放到最后

GRADLE_HOME=/全路径/gradle-5.2.1/bin
JAVA_HOME=/全路径/jdk1.8.0_181.jdk/Contents/Home
PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin:$GRADLE_HOME:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.

export GRADLE_HOME
export JAVA_HOME
export PATH
export CLASSPATH

$ export PATH=$PATH:/opt/gradle/gradle-5.2.1/bin
Microsoft Windows users
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-5.2.1\bin. Click OK to save.

Step 4. Verify your installation

Open a console (or a Windows command prompt) and run gradle -v to run gradle and display the version, e.g.:

$ gradle -v

下载 Spring 源码

git clone https://github.com/spring-projects/spring-framework.git

使用命令行编译源码(推荐)

https://www.cnblogs.com/huang0925/p/3458507.html
将来使用idea

E:\SpringSource\spring-framework>cd spring-tx
E:\SpringSource\spring-framework\spring-tx>gradle cleanidea idea

将来使用eclipse

E:\SpringSource\spring-framework>cd spring-tx
E:\SpringSource\spring-framework\spring-tx>gradle cleanidea eclipse
使用 idea 编译 Spring 源码

https://blog.youkuaiyun.com/baomw/article/details/83956300

在这里插入图片描述

最佳实践
idea 搜索源码

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值