gpt4 book ai didi

gradle - 在Intellij中遇到Gradle构建失败;要求更新5.0+

转载 作者:行者123 更新时间:2023-12-03 04:56:46 27 4
gpt4 key购买 nike

错误信息:


Error:(52, 0) This version of Shadow supports Gradle 5.0+ only. Please upgrade.
<a href="openFile:/Users/jmitesh/Documents/open-source/waltz/build.gradle">Open File</a>


build.gradle文件(第52行- apply plugin: "com.github.johnrengelman.shadow)

由于我是Gradle和学习的新手,如何解决此问题?
allprojects {
apply plugin: 'idea'

repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'http://packages.confluent.io/maven/' }
}
}

project.ext {
apacheHttpClientVersion = "4.5.6"
commonsCliVersion = '1.4'
h2Version = '1.3.175'
hamcrestVersion = '1.3'
junitVersion = '4.11'
mariadbDriverVersion = '2.4.2'
nettyVersion = '4.1.15.Final'
slf4jVersion = '1.7.25'
mockitoVersion = '1.9.5'
assertjVersion = '3.8.0'
zkToolsVersion = '0.5.0'
yamlVersion = '1.20'
riffVersion = '2.4.2'
jacksonVersion = '2.9.6'
jettyVersion = '9.4.12.v20180830'

mainClass = 'Main'
}

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1'
classpath "com.github.jengelman.gradle.plugins:shadow:5.1.0"
classpath 'se.transmode.gradle:gradle-docker:1.2'
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: 'maven-publish'
apply plugin: 'signing'

configurations.all {
resolutionStrategy {
force "org.hamcrest:hamcrest-all:$hamcrestVersion"
}
}

jar {
manifest {
attributes(
"Implementation-Title": "Waltz",
"Implementation-Version": version)
}
}

compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

compileTestJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

checkstyle {
toolVersion = "8.10"
}

checkstyleTest {
configFile = project.file ("${rootProject.projectDir}/config/checkstyle/checkstyle_test.xml")
}

// findbugs html only report
findbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}

findbugsTest {
reports {
xml.enabled = false
html.enabled = true
}
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}

task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = project.name

from components.java
artifact sourcesJar
artifact javadocJar

pom {
name = 'Waltz'
description = 'Waltz is a distributed/replicated write ahead log for transactions.'
url = 'https://www.github.com/wepay/waltz'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ymatsuda'
name = 'Yasuhiro Matsuda'
}
}
scm {
connection = 'scm:git:git://github.com/wepay/waltz.git'
developerConnection = 'scm:git:ssh://github.com/wepay/waltz.git'
url = 'https://github.com/wepay/waltz'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username findProperty('ossrhUsername')?: ''
password findProperty('ossrhPassword')?: ''
}
}
}
}

signing {
sign publishing.publications.mavenJava
}

task execute(type:JavaExec) {
main = mainClass
classpath = sourceSets.main.runtimeClasspath
if (project.hasProperty("commandArgs")) {
args commandArgs.split()
}
standardInput = System.in
}
}

project(':waltz-tools') {
dependencies {
compile (
project(':waltz-client'),
project(':waltz-server'),
project(':waltz-storage'),

"org.apache.httpcomponents:fluent-hc:$apacheHttpClientVersion"
)

testCompile (
// TODO remove cyclic dependency
// Not super thrilled about this, as it creates a circular dependency between
// watlz-util and waltz-test. waltz-tools needs ZK server runner for tests, and
// waltz-test needs to be able to create clusters to run smoke test and demo.
project(':waltz-test'),

"junit:junit:$junitVersion",
"org.mockito:mockito-all:$mockitoVersion"
)
}

task copyLibs(type:Copy) {
into file("$projectDir/build/libs")
from sourceSets.main.runtimeClasspath
}
}

project(':waltz-server') {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'application'
apply plugin: 'docker'

dependencies {
compile (
project(':waltz-common'),
project(':waltz-storage'),

"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"com.wepay.riff:riff-config:$riffVersion",
"com.wepay.riff:riff-metrics:$riffVersion",
"com.wepay.zktools:zktools:$zkToolsVersion",
"io.netty:netty-all:$nettyVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"org.eclipse.jetty:jetty-server:$jettyVersion",
"org.eclipse.jetty:jetty-servlet:$jettyVersion",
)

testCompile (
project(':waltz-client'),
project(':waltz-test'),

"junit:junit:$junitVersion",
"org.mockito:mockito-all:$mockitoVersion"
)
}

test {
maxHeapSize = "2G"
jvmArgs '-Xmx2G'
}

distDocker {
mainClassName = 'com.wepay.waltz.server.WaltzServer'
workingDir "${rootProject.name}-${project.version}"
}
}

project(':waltz-storage') {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'application'
apply plugin: 'docker'

dependencies {
compile (
project(':waltz-common'),

"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
"com.wepay.riff:riff-config:$riffVersion",
"com.wepay.riff:riff-metrics:$riffVersion",
"com.wepay.zktools:zktools:$zkToolsVersion",
"io.netty:netty-all:$nettyVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"org.yaml:snakeyaml:$yamlVersion",
"org.eclipse.jetty:jetty-server:$jettyVersion",
"org.eclipse.jetty:jetty-servlet:$jettyVersion",
)

testCompile (
project(':waltz-test'),

"junit:junit:$junitVersion",
"org.mockito:mockito-all:$mockitoVersion"
)
}

distDocker {
mainClassName = 'com.wepay.waltz.storage.WaltzStorage'
workingDir "${rootProject.name}-${project.version}"
runCommand 'mkdir /waltz_storage'
}
}

project(':waltz-uber') {
dependencies {
compile(
project(':waltz-server'),
project(':waltz-tools')
)

testCompile (
project(':waltz-server')
)

runtime (
"org.slf4j:slf4j-log4j12:$slf4jVersion"
)
}

shadowJar {
baseName = project.name
classifier = null
version = version
}
}

project(':waltz-uber').build.dependsOn project(':waltz-uber').shadowJar
project(':waltz-uber').artifactoryPublish.dependsOn project(':waltz-uber').shadowJar

project(':waltz-client') {
dependencies {
compile (
project(':waltz-common'),

"com.wepay.riff:riff-config:$riffVersion",
"com.wepay.zktools:zktools:$zkToolsVersion",
"io.netty:netty-all:$nettyVersion",
"org.slf4j:slf4j-api:$slf4jVersion"
)

testCompile (
project(':waltz-test'),

"com.h2database:h2:$h2Version",
"junit:junit:$junitVersion"
)
}
}

project(':waltz-common') {
dependencies {
compile (
"com.wepay.riff:riff-config:$riffVersion",
"com.wepay.riff:riff-metrics:$riffVersion",
"com.wepay.riff:riff-networking:$riffVersion",
"com.wepay.zktools:zktools:$zkToolsVersion",
"commons-cli:commons-cli:$commonsCliVersion",
"io.netty:netty-all:$nettyVersion",
"org.slf4j:slf4j-api:$slf4jVersion",
"org.yaml:snakeyaml:$yamlVersion"
)

testCompile (
project(':waltz-test'),

"junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion",
"org.mockito:mockito-all:$mockitoVersion"
)
}
}

project(':waltz-test') {
dependencies {
compile (
project(':waltz-server'),
project(':waltz-client'),
project(':waltz-storage'),
project(':waltz-tools'),

"com.wepay.zktools:zktools:$zkToolsVersion",
"io.netty:netty-all:$nettyVersion"
)

testCompile (
"junit:junit:$junitVersion"
)
}

task copyLibs(type:Copy) {
into file("$projectDir/build/libs")
from sourceSets.main.runtimeClasspath
}
}

project(':waltz-demo') {
dependencies {
compile (
project(':waltz-server'),
project(':waltz-client'),
project(':waltz-test'),
project(':waltz-tools'),

"org.mariadb.jdbc:mariadb-java-client:$mariadbDriverVersion"
)

testCompile (
"com.h2database:h2:$h2Version",
"junit:junit:$junitVersion"
)
}

shadowJar {
baseName = project.name
classifier = null
version = version
}

}

project(':waltz-demo').build.dependsOn project(':waltz-demo').shadowJar
project(':waltz-demo').artifactoryPublish.dependsOn project(':waltz-demo').shadowJar

最佳答案

通过安装新版本来升级Gradle的本地安装。或升级Gradle包装器:https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper

关于gradle - 在Intellij中遇到Gradle构建失败;要求更新5.0+,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57936355/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com