Gradle

一。下载并解压安装

下载地址

配置环境变量,cmd命令gradle -v查看是否安装成功
在这里插入图片描述

二。配置本地仓库与远程仓库

环境变量:Gradle_USER_HOME 指向本地仓库 D:\Maven\apache-maven-3.5.4\cangku

三。Build.Gradle范本

repositories {
   mavenLocal()
   mavenCentral()
   maven { url "http://47.96.230.188:8081/repository/Public_Repositories/" }
}

dependencies {    
   testCompile group:'junit',name:'junit',version:'4.12'
   compileOnly "org.projectlombok:lombok:${lombok_version}"
   compile group:'junit',name:'junit',version:'4.12'
   
   testImplementation 'org.springframework.boot:spring-boot-starter-test'
   testImplementation 'org.springframework.security:spring-security-test'
   implementation "org.springframework.boot:spring-boot-starter-actuator"
   
   //lombok工具包
   annotationProcessor "org.projectlombok:lombok:${lombok_version}"
   
   mybatisGenerator "mysql:mysql-connector-java"
   mybatisGenerator "org.mybatis.generator:mybatis-generator-core:1.3.7"
   
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}

四。Gradle dependenciens的各种依赖说明

implementation  对该项目有依赖的项目将无法访问到使用该命令编译的依赖中的任何程序,也就是将该依赖隐藏在内部,而不对外部公开。
compile         这种是我们最常用的方式,使用该方式依赖的库将会参与编译和打包。
api             完全等同于compile指令。
testCompile     只在单元测试代码的编译以及最终打包测试apk时有效。
debugCompile    只在debug模式的编译和最终的debug apk打包时有效
releaseCompile  仅仅针对Release模式的编译和最终的Release apk打包

annotationProcessor 
compileOnly     只编译不打包

五。打jar包

见maven 打jar包参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飘然生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值