我一直在尝试安装warp10,为了实现这一点,我需要gradle 5.0。但是,要更新gradle,我首先需要更新Shadow插件。我已经找到了这一资源,但我不知道该将以下代码块放在哪里:
plugins { id“com.github.johnrengelman.plugin-影子”版本"2.0.3“}
有人知道怎么做吗?
提前谢谢!致以问候。
发布于 2019-07-24 16:13:23
shadow的当前版本是5.1.0。
并且包含它应该像在build.gradle中包含这个块一样简单。
plugins {
id "com.github.johnrengelman.shadow" version "5.1.0"
}看看:https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow/
这是Gradle脚本的一个例子:
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import java.nio.charset.StandardCharsets
import java.time.ZoneOffset
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
id "application" // https://docs.gradle.org/current/userguide/application_plugin.html
id "com.github.johnrengelman.shadow" version "5.1.0" // Shadow here ;)
id "eclipse"
id "idea"
id "java"
id "com.github.johnrengelman.shadow" version "5.1.0"
id "org.flywaydb.flyway" version "5.2.4"
id "org.springframework.boot" version "2.1.6.RELEASE"
}
// apply from: "another.gradle"
// apply plugin: "io.spring.dependency-management"
group = "io.shido"
version = "0.0.1-SNAPSHOT"
description = "Container-based Spring Boot Application"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
configurations {
// all*.exclude module: "spring-boot-starter-tomcat"
}
repositories {
// mavenLocal() // Uncomment when needed
jcenter()
}
dependencies {
//-----------------------------------------------------------------------------------------------
// Experimental Dependencies
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
// BOM Support
//-----------------------------------------------------------------------------------------------
implementation platform("org.springframework.boot:spring-boot-dependencies:2.1.6.RELEASE")
//-----------------------------------------------------------------------------------------------
// Project Dependencies
//-----------------------------------------------------------------------------------------------
implementation "org.apache.commons:commons-lang3"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-starter-web"
runtimeOnly "com.h2database:h2" // FIXME: Must change/delete this for the real driver/dependency
runtimeOnly "org.flywaydb:flyway-core"
runtimeOnly "org.springframework.boot:spring-boot-starter-actuator" // FIXME: Very careful with this one ;)
//-----------------------------------------------------------------------------------------------
// Test Dependencies
//-----------------------------------------------------------------------------------------------
testImplementation "nl.jqno.equalsverifier:equalsverifier:3.1.9"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-engine"
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}
//=================================================================================================
// P L U G I N S
//=================================================================================================
application {
mainClassName = "io.shido.Application"
}
//=================================================================================================
// T A S K S
//=================================================================================================
tasks.withType(Jar) {
final def attrs = [
"Application-Name": project.name,
"Build-Date": ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_DATE_TIME),
//"Build-Number": ,
"Created-By": System.getProperty("user.name"),
"Gradle-Version": gradle.gradleVersion,
"Implementation-Title": project.name,
"Implementation-Vendor": "Vendor Here",
"Implementation-Version": project.version, // ...should be the build number
"Specification-Title": project.name,
"Specification-Vendor": "Vendor Here",
"Specification-Version": project.version,
"JDK-Version": System.getProperty("java.version"),
]
manifest { attributes(attrs) }
}
tasks.withType(JavaCompile) {
options.encoding = "${StandardCharsets.UTF_8}"
}
tasks.withType(Test) {
testLogging {
events = [TestLogEvent.FAILED, TestLogEvent.SKIPPED]
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
}
useJUnitPlatform()
}
//-------------------------------------------------------------------------------------------------
// Custom Tasks
//-------------------------------------------------------------------------------------------------https://stackoverflow.com/questions/57187135
复制相似问题