gradle基本使用
下载地址:https://services.gradle.org/distributions/
Gradle 官方用户手册:https://docs.gradle.org/current/userguide/userguide.html
中文手册:
https://doc.yonyoucloud.com/doc/wiki/project/GradleUserGuide-Wiki/index.html
https://dongchuan.gitbooks.io/gradle-user-guide-/content/
https://github.com/DONGChuan/GradleUserGuide
Groovy基础:http://attis-wong-163-com.iteye.com/blog/1239819
Groovy闭包的Delegate机制:https://www.cnblogs.com/zqlxtt/p/5741297.html
构建命令
清理命令
gradle clean
构建打包命令
gradle clean build
编译时跳过测试,使用-x
,-x
参数用来排除不需要执行的任务
gradle clean build -x test
创建缓存依赖
执行命令gradle clean build --refresh-dependencies
或删除.gradle/caches目录,构建的时候它会下载所有依赖并加入到缓存中。
阿里云镜像
buildscript {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
}
maven项目转换为gradle项目
根目录执行
gradle init --type pom
settings.gradle配置
是模块Module配置文件,大多数setting.gradle的作用是为了配置子工程,根目录下的settings.gradle脚本文件是针对module的全局配置,它的作用域所包含的所有module是通过settings.gradle来配置。
settings.gradle用于创建多Project的Gradle项目。Project在IDEA里对应Module模块。
例如配置module名rootProject.name = 'DyoonPLM'
Gradle项目配置中指定的编码格式
如果使用了Gradle管理项目,我们需要特定的搭配
Java编译器GBK+控制台GBK+文本编码UTF-8+build.gradle配置为UTF-8
打开项目的build.gradle
文件,向其中加入下列代码
tasks.withType(JavaCompile){
options.encoding="UTF-8" //这里最好选择UTF-8
}
相关文章
- postgresql乱码怎么办
- linux如何卸载postgresql
- postgresql是否支持json类型
- hadoop是什么
- 如何查看是否安装postgresql
- postgresql启动不了如何解决
- postgresql服务启动报错1053怎么解决
- postgresql怎么启动服务
- 怎样删除postgresql
- postgresql安装错误的原因是什么
- postgresql服务怎么安装启动
- 怎么判断postgresql是否存在
- postgresql启动不了怎么解决
- 如何彻底卸载postgresql
- linux下如何查看是否安装postgresql
- linux下postgresql怎么启动
- postgresql中怎么抛出异常
- postgresql如何登录
- postgresql异常怎么重启
- VB怎么连接PostgreSQL