搭建步骤如下
一、新建项目
二、填写项目名称
三、项目目录
四、gradle配置文件(build.gradle)
plugins {
id 'java'
}
group 'com.starter.example'
version '1.0-SNAPSHOT'
repositories {
maven {
allowInsecureProtocol = true
url "http://maven.aliyun.com/nexus/content/groups/public"
}
mavenCentral()
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
implementation 'org.springframework.boot:spring-boot-starter:2.3.1.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '2.3.12.RELEASE'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.3.1.RELEASE'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'com.alibaba', name: 'fastjson', version: '2.0.0'
implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.6.6'
testImplementation 'org.projectlombok:lombok:1.18.20'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
test {
useJUnitPlatform()
}