2020-01-10 21:48:43 +08:00
|
|
|
plugins {
|
2020-01-23 03:24:37 +08:00
|
|
|
id "java"
|
|
|
|
id "org.springframework.boot.deployed"
|
|
|
|
id "org.springframework.boot.conventions"
|
|
|
|
id "org.springframework.boot.integration-test"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
description = "Spring Boot CLI"
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
dependenciesBom
|
|
|
|
loader
|
|
|
|
testRepository
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-01-23 06:09:17 +08:00
|
|
|
compileOnly(project(":spring-boot-project:spring-boot"))
|
|
|
|
compileOnly("jakarta.servlet:jakarta.servlet-api")
|
2022-03-18 20:34:13 +08:00
|
|
|
compileOnly("org.apache.groovy:groovy-templates")
|
2020-01-23 06:09:17 +08:00
|
|
|
compileOnly("org.springframework:spring-web")
|
2020-01-23 03:24:37 +08:00
|
|
|
|
2020-01-23 06:09:17 +08:00
|
|
|
dependenciesBom(project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "effectiveBom"))
|
2020-01-23 03:24:37 +08:00
|
|
|
|
2020-01-23 06:09:17 +08:00
|
|
|
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
|
|
|
|
implementation("com.vaadin.external.google:android-json")
|
|
|
|
implementation("jline:jline")
|
|
|
|
implementation("net.sf.jopt-simple:jopt-simple")
|
2020-01-23 03:24:37 +08:00
|
|
|
implementation("org.apache.httpcomponents:httpclient") {
|
|
|
|
exclude group: "commons-logging", module: "commons-logging"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2020-01-23 06:09:17 +08:00
|
|
|
implementation("org.apache.maven:maven-model")
|
2020-01-23 03:24:37 +08:00
|
|
|
implementation("org.apache.maven:maven-resolver-provider") {
|
|
|
|
exclude group: "com.google.guava", module: "guava"
|
2021-11-13 01:54:32 +08:00
|
|
|
exclude group: "javax.inject", module: "javax.inject"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2020-01-23 06:09:17 +08:00
|
|
|
implementation("org.apache.maven.resolver:maven-resolver-connector-basic")
|
|
|
|
implementation("org.apache.maven.resolver:maven-resolver-transport-file")
|
2020-01-23 03:24:37 +08:00
|
|
|
implementation("org.apache.maven.resolver:maven-resolver-transport-http") {
|
|
|
|
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2021-11-13 01:54:32 +08:00
|
|
|
implementation("org.apache.maven:maven-settings-builder") {
|
|
|
|
exclude group: "javax.inject", module: "javax.inject"
|
|
|
|
}
|
2022-03-18 20:34:13 +08:00
|
|
|
implementation("org.apache.groovy:groovy")
|
2020-01-23 06:09:17 +08:00
|
|
|
implementation("org.slf4j:slf4j-simple")
|
|
|
|
implementation("org.sonatype.plexus:plexus-sec-dispatcher")
|
2020-01-23 03:24:37 +08:00
|
|
|
implementation("org.sonatype.sisu:sisu-inject-plexus") {
|
|
|
|
exclude group: "javax.enterprise", module: "cdi-api"
|
|
|
|
exclude group: "org.sonatype.sisu", module: "sisu-inject-bean"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2020-01-23 06:09:17 +08:00
|
|
|
implementation("org.springframework:spring-core")
|
|
|
|
implementation("org.springframework.security:spring-security-crypto")
|
2020-01-23 03:24:37 +08:00
|
|
|
|
2020-01-23 06:09:17 +08:00
|
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
|
|
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
|
|
intTestImplementation("org.assertj:assertj-core")
|
|
|
|
intTestImplementation("org.junit.jupiter:junit-jupiter")
|
|
|
|
intTestImplementation("org.springframework:spring-core")
|
2020-01-23 03:24:37 +08:00
|
|
|
|
2020-01-23 06:09:17 +08:00
|
|
|
loader(project(":spring-boot-project:spring-boot-tools:spring-boot-loader"))
|
2020-01-23 03:24:37 +08:00
|
|
|
|
2021-06-17 02:07:00 +08:00
|
|
|
testCompileOnly("org.apache.tomcat.embed:tomcat-embed-core")
|
2020-01-23 06:09:17 +08:00
|
|
|
testImplementation(project(":spring-boot-project:spring-boot"))
|
|
|
|
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
|
|
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
|
|
|
testImplementation("org.assertj:assertj-core")
|
2022-03-18 20:34:13 +08:00
|
|
|
testImplementation("org.apache.groovy:groovy-templates")
|
2020-01-23 06:09:17 +08:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
|
|
testImplementation("org.mockito:mockito-core")
|
2020-08-08 22:53:42 +08:00
|
|
|
testImplementation("org.mockito:mockito-junit-jupiter")
|
2020-01-23 06:09:17 +08:00
|
|
|
testImplementation("org.springframework:spring-test")
|
2020-01-23 03:24:37 +08:00
|
|
|
|
2020-01-23 06:09:17 +08:00
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-amqp", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-aop", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-artemis", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-batch", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-integration", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-security", configuration: "mavenRepository"))
|
|
|
|
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-web", configuration: "mavenRepository"))
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task syncSpringBootDependenciesBom(type: Sync) {
|
2020-01-22 10:33:33 +08:00
|
|
|
destinationDir = file("${buildDir}/generated-resources/org/springframework/boot/cli/compiler/dependencies")
|
2020-01-10 21:48:43 +08:00
|
|
|
from configurations.dependenciesBom
|
|
|
|
}
|
|
|
|
|
|
|
|
task syncTestRepository(type: Sync) {
|
|
|
|
destinationDir = file("${buildDir}/test-repository")
|
|
|
|
from configurations.testRepository
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
2020-01-23 03:24:37 +08:00
|
|
|
output.dir("${buildDir}/generated-resources", builtBy: "syncSpringBootDependenciesBom")
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
dependsOn syncTestRepository
|
|
|
|
}
|
|
|
|
|
|
|
|
task fullJar(type: Jar) {
|
2021-03-31 03:51:33 +08:00
|
|
|
dependsOn configurations.loader
|
2020-01-23 03:24:37 +08:00
|
|
|
classifier = "full"
|
|
|
|
entryCompression = "stored"
|
2020-01-10 21:48:43 +08:00
|
|
|
from(configurations.runtimeClasspath) {
|
2020-01-23 03:24:37 +08:00
|
|
|
into "BOOT-INF/lib"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
from(sourceSets.main.output) {
|
2020-01-23 03:24:37 +08:00
|
|
|
into "BOOT-INF/classes"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2021-03-31 03:41:46 +08:00
|
|
|
from {
|
|
|
|
zipTree(configurations.loader.singleFile).matching {
|
2021-02-05 20:04:01 +08:00
|
|
|
exclude "META-INF/LICENSE.txt"
|
|
|
|
exclude "META-INF/NOTICE.txt"
|
2022-02-12 05:31:20 +08:00
|
|
|
exclude "META-INF/spring-boot.properties"
|
2021-02-05 20:04:01 +08:00
|
|
|
}
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
manifest {
|
|
|
|
attributes(
|
2020-01-23 03:24:37 +08:00
|
|
|
"Class-Loader": "groovy.lang.GroovyClassLoader",
|
|
|
|
"Main-Class": "org.springframework.boot.loader.JarLauncher",
|
|
|
|
"Start-Class": "org.springframework.boot.cli.SpringCli"
|
2020-01-10 21:48:43 +08:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def configureArchive(archive) {
|
2020-01-23 03:24:37 +08:00
|
|
|
archive.classifier = "bin"
|
2020-01-10 21:48:43 +08:00
|
|
|
archive.into "spring-${project.version}"
|
|
|
|
archive.from(fullJar) {
|
|
|
|
rename {
|
|
|
|
it.replace("-full", "")
|
|
|
|
}
|
2020-01-23 03:24:37 +08:00
|
|
|
into "lib/"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2020-01-23 03:24:37 +08:00
|
|
|
archive.from(file("src/main/content")) {
|
2020-06-03 18:46:01 +08:00
|
|
|
dirMode = 0755
|
|
|
|
fileMode = 0644
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
2020-01-23 03:24:37 +08:00
|
|
|
archive.from(file("src/main/executablecontent")) {
|
2020-06-03 18:46:01 +08:00
|
|
|
fileMode = 0755
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task zip(type: Zip) {
|
2020-01-23 03:24:37 +08:00
|
|
|
classifier = "bin"
|
2020-01-10 21:48:43 +08:00
|
|
|
configureArchive it
|
|
|
|
}
|
|
|
|
|
|
|
|
intTest {
|
|
|
|
dependsOn syncTestRepository, zip
|
|
|
|
}
|
|
|
|
|
|
|
|
task tar(type: Tar) {
|
2020-01-23 03:24:37 +08:00
|
|
|
compression = "gzip"
|
|
|
|
archiveExtension = "tar.gz"
|
2020-01-10 21:48:43 +08:00
|
|
|
configureArchive it
|
|
|
|
}
|
|
|
|
|
|
|
|
task scoopManifest(type: org.springframework.boot.build.cli.ScoopManifest) {
|
|
|
|
dependsOn zip
|
2020-01-22 10:33:33 +08:00
|
|
|
outputDir = file("${buildDir}/scoop")
|
2020-01-23 03:24:37 +08:00
|
|
|
template = file("src/main/scoop/springboot.json")
|
2020-01-10 21:48:43 +08:00
|
|
|
archive = zip.archiveFile
|
|
|
|
}
|
|
|
|
|
2020-01-23 03:24:37 +08:00
|
|
|
def scoopManifestArtifact = artifacts.add("archives", file("${buildDir}/scoop/springboot.json")) {
|
|
|
|
type "json"
|
|
|
|
classifier "scoop"
|
|
|
|
builtBy "scoopManifest"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task homebrewFormula(type: org.springframework.boot.build.cli.HomebrewFormula) {
|
|
|
|
dependsOn tar
|
2020-01-22 10:33:33 +08:00
|
|
|
outputDir = file("${buildDir}/homebrew")
|
2021-01-07 09:01:22 +08:00
|
|
|
template = file("src/main/homebrew/spring-boot.rb")
|
2020-01-10 21:48:43 +08:00
|
|
|
archive = tar.archiveFile
|
|
|
|
}
|
|
|
|
|
2021-01-07 09:01:22 +08:00
|
|
|
def homebrewFormulaArtifact = artifacts.add("archives", file("${buildDir}/homebrew/spring-boot.rb")) {
|
2020-01-23 03:24:37 +08:00
|
|
|
type "rb"
|
|
|
|
classifier "homebrew"
|
|
|
|
builtBy "homebrewFormula"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
2020-01-23 03:24:37 +08:00
|
|
|
getByName("maven") {
|
2020-01-10 21:48:43 +08:00
|
|
|
artifact fullJar
|
|
|
|
artifact tar
|
|
|
|
artifact zip
|
|
|
|
artifact scoopManifestArtifact
|
|
|
|
artifact homebrewFormulaArtifact
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|