当前位置:网站首页>gradle项目中 build.gradle 配置文件详解(未完成)
gradle项目中 build.gradle 配置文件详解(未完成)
2022-07-16 01:17:00 【猎人在吃肉】
build.gradle 示例
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
各组件说明
标签list:
1)插件 plugins
plugins {
id 'java'
id 'application'
}
2)项目信息
group 'com.kepus'
version '1.0-SNAPSHOT'
3) jdk版本声明
//sourceCompatibility 为project实例的属性
sourceCompatibility = 1.8
targetCompatibility = 1.8
4) 仓库地址
//repositories是project一个方法,闭包作为参数
repositories {
//本地仓库,地址是:D:/maven/maven_repositories/
mavenLocal()
//应该是maven私服,国内镜像地址
maven{
url "http://maven.aliyun.com/nexus/content/groups/public"
}
//远程仓库,地址是https://repo1.maven.org/maven2
mavenCentral()
}
5)依赖配置 dependencies
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'{
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
6) plugin 块 和 buildscript 块 位置说明
需要注意的是,在 build.gradle 文件中,plugin 块 和 buildscript 块 ,必须作为 前两个块 存在,否则会报错的。
7)测试
test {
useJUnitPlatform()
}
边栏推荐
- 普乐蛙4d5d动感影院|VR太空旅行设备|VR带你遨游太空
- Kettle【实践 02】txt类型文件分类导入后执行SQL进行数据类型转换并入库(完整流程实例云资源分享:包含sql+kjb+ktr+测试文件)
- Jupyterab installation
- Reading notes: self cultivation of programmers - Chapter 1
- Résolution du format d'image
- uniapp uni-popup change
- Analysis of common interview questions in MySQL
- 深度学习------验证码
- Using mysql+excel to process data
- 1523. 在区间范围内统计奇数数目
猜你喜欢

【idea】idea添加vm options

【转载】LaTeX中的空格汇总

二叉树遍历

MySQL之常见面试题分析

Matlab drawing_ 1 draw attenuation oscillation curve

JVM调优实战(详细版)
![[image fusion] multi focus image fusion in DCT domain based on MATLAB [including Matlab source code, 1973]](/img/91/087665822e3b8cd2ec7f8f7f7360c7.png)
[image fusion] multi focus image fusion in DCT domain based on MATLAB [including Matlab source code, 1973]

JupyterLab安装

Traditional gyms are trapped in large-scale, and Lexus sports "s2b2c" mode is the reference answer?

Power BI----到底什么是度量值?
随机推荐
IC classification of speech chip and comparison and selection of OTP speech chip of sop8
PDB 常用命令
pinctrl子系统和gpio子系统
GDB or delve debug Go program, check variable display < optimized out > solution
【名词】LTS
map集合转对象,map字段有横线,对象转map
2022年7月16日CDGA/CDGP数据治理认证考试成绩出来啦!
1523. 在区间范围内统计奇数数目
Map set to object, map field has horizontal lines, object to map
使用nlmeas对图像进行去噪
迅为龙芯开发板国产双核64位Loognix系统双千兆以太网更多接口
图片格式解析
279. 完全平方数
YGG established a new subdao - YGG Japan
DDD Domain Driven Design
openEuler 知:SIG
【YOLO】v5s 6.1版本LoadStreams类源码解读
uniapp uni-popup change
Heavyweight: Mobileye officially announced the postponement of IPO, slowing down the growth of revenue and intensifying market competition
UE5簡單的角色碰撞檢測功能