avatar👨‍💻
BestGuo2020BestGuo 的小窝

face-lift

一个人的世界是如此安静

Gradle 学习小记

一些命令

编译项目

sh
gradle classes

运行测试

sh
gradle test

构建项目

sh
gradle build

构建项目时跳过测试

sh
gradle build -x test

清空 build 目录

sh
gradle clean

修改 maven 下载源

在 Gradle 安装目录下的 init.d 文件夹下添加以 gradle 为扩展文件名的脚本文件,加载时修改成国内源。文件名为 init.gradle。

groovy
allprojects {
	repositories {
		mavenLocal ()
		maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" }
		maven { name "Bstek" ; url "https://nexus.bsdn.org/content/groups/public/" }
		mavenCentral ()
	}

	buildscript {
		repositories{
			maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
			maven { name "Bstek" ; url 'https://nexus.bsdn.org/content/groups/public/' }
			maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }
		}
	}
}

mavenLocal:寻找 Maven 本地仓库中的 jar 包。

mavenCentral:寻找 Maven 国外的镜像仓库中的 jar 包。

maven:指定仓库地址。

java-jwt
MongoDB 学习笔记