当前位置:网站首页>Installation, configuration and use of gradle
Installation, configuration and use of gradle
2022-07-27 06:32:00 【Leoon123】
One 、gradle Installation
1. Download link on official website :https://gradle.org/releases/

1、 Decompress after downloading


2、 Configure environment variables , newly build GRADLE_HOME Environment variables point to your Gradle Decompression path

3、 take %GRADLE_HOME%\bin Add to Path In the environment variables , Then click OK

4、 verification gradle Is the installation successful , open cmd Command line input gradle -v

5、 To configure gradle Warehouse address
1、gradle and maven similar , You also need to configure the warehouse address , First, create a new folder

2、 Configure the default warehouse address in the environment variable

3、 Configure alicloud image
1. stay gradle Medium init.d Create a new init.gradle file , And add the following configuration in the file

The configuration is as follows :
allprojects {
repositories {
mavenLocal()
maven {
name "Alibaba" ; url "https://maven.aliyun.com/repository/public" }
maven {
name "Bstek" ; url "http://nexus.bsdn.org/content/groups/public/" }
mavenCentral()
}
buildscript {
repositories {
maven {
name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
maven {
name "Bstek" ; url 'http://nexus.bsdn.org/content/groups/public/' }
maven {
name "M2" ; url 'https://plugins.gradle.org/m2/' }
}
}
}
6、 stay idea Open in gradle Projects built
5、 choice File->Settings->Build Tools->Gradle
If you use this method to build an error :Execution failed for task ‘:compileJava’.,Could not resolve all dependencies for configuration ‘:compileClasspath’. perhaps no tasks available , It's yours idea And yours gradle Problems caused by version incompatibility , There's a problem , You need to change your diea Configuration of , Mode 2
Mode one :


Mode two :

7、gradle Introduction of project documents
| Directory file | effect |
|---|---|
| .gradle gradle Project generated documents | ( Files generated by automatic compilation tool ) |
| .idea | IDEA Project documents ( Files generated by development tools ) |
| app | One of them module, Reuse the settings of the parent project , You can have the same configuration file as the parent project |
| build | Where files are generated during automatic build |
| gradle | Done automatically gradle Environment support folder |
| .gitignore | git Source code management document |
| build.gradle | gradle The configuration file that the project compiles automatically |
| gradle.properties | gradle Run environment profile |
| gradlew | Done automatically gradle Environmental linux mac Script , coordination gradle Folder usage |
| gradlew.bat | Done automatically gradle Environmental windows Script , coordination gradle Folder usage |
| local.properties | Android SDK NDK Environment path configuration |
| *.iml | IDEA Project documents |
| setting.gradle | gradle The subproject of the project contains files |
The problem record
1、Could not get unknown property ‘container’ for root project ‘antiviral-reports’ of type org.gradle.api.Project.

Solution : It can be seen from the problem that there is a lack of container The definition of this variable , So add gradle Run environment profile gradle.properties , add to container=‘ The variable value you define ’

2、IntelliJ idea solve junit no tasks available The problem of
Reference article :https://blog.csdn.net/qq_27093465/article/details/102738596
边栏推荐
- Simple understanding of network principle
- Shell script if nested for loop script
- Unity shader overview
- Establishment of FTP server
- 5g's past and present life -- a brief introduction to the development of mobile communication
- Learning records of programming -- Lesson 2 [first knowledge of C language]
- Automated Deployment Project
- 数据库的联合查询
- Linear progression for face recognition
- C language - dynamic memory management
猜你喜欢

单元集成(接⼝)测试

Unable to start program, access denied?

TF coordinate transformation

Wireshark packet modification -- IP address modification (I)

shell编程规范与变量

Ulcl function --5gc

学习软件测试时需要配备的运行环境需求搭建

Joint query of database

Detailed explanation of thread safety problems

Shell programming specifications and variables
随机推荐
Unityshader Gaussian blur
[first blog - outlook]
Shell脚本编写格式
接口测试流程及面试问题
Non photorealistic rendering (NPR) paper understanding and reproduction (unity) - stylized highlights for cartoon rendering and animation
兼容性测试知识点
5g network identity - detailed explanation of 5g Guti
Programming learning records - Lesson 8 [array and design Gobang, minesweeping game]
Li Kou's first week's wrong question set
关于testng相关标签的使用
DNS域名解析服务
七大排序详解
Reading and writing of file content - data flow
Common SQL optimization methods
Stress performance test of website based on AB tool under Apache
Addition, deletion, modification and query of the database at the terminal
Unity practical tips (updating)
如何规范式编写yaml文件
Launch file of ROS operation management
The concept of interface testing and the use of postman tools