当前位置:网站首页>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
边栏推荐
- ROS node name duplicate
- Brief introduction to unity window interface
- Introduction to Wireshark graphical interface
- selenium知识点
- Programming learning record -- recursively solving the tower of Hanoi problem
- Remote sensing image recognition imaging synthesis
- 数据库的索引和事务(重点)
- This is my blog
- bug分类及缺陷和csv文件测试
- 5g network identity - detailed explanation of 5g Guti
猜你喜欢
随机推荐
英语基础知识:定语使用规则下篇
数组及下标索引
兼容性测试知识点
源码编译安装LAMP和DISCUZ论坛
Linear progression for face recognition
英语基础知识:修饰性的句子成分-上篇
软件测试基础概念篇
英语基础知识: 并列结构
Common SQL optimization methods
ROS node name duplicate
Unityshader depth texture (understanding and problems encountered)
Some descriptions and usage of database index
Related knowledge of internal classes
Programming learning records - Lesson 5 [branch and loop statements]
[first blog - outlook]
Learning records of programming -- Lesson 2 [first knowledge of C language]
Array and subscript index
Unit integration (grounding) test
Chapter for software testing
Basic file operation of cmder









