gradle常用方法收集

1、初始化一个gradle目录结构化的java工程

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
gradle init --type java-application
gradle init --type java-application
gradle init --type java-application

2、初始化一个gradle目录结构化的java库工程

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
gradle init --type java-library
gradle init --type java-library
gradle init --type java-library

3、速度太慢想切换国内镜像

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
...
}
repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } ... }
repositories {
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
    ...
}

4、查看依赖树

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
gradle dependencies
gradle dependencies
gradle dependencies

5、更新项目中的gradle版本

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
./gradlew wrapper --gradle-version 6.0.1
./gradlew wrapper --gradle-version 6.0.1
./gradlew wrapper --gradle-version 6.0.1

 

Leave a Reply

Your email address will not be published. Required fields are marked *