我在尝试构建我的 gralde 项目时遇到了这个错误。 运行
./gradlew build clean
通过在标题中显示错误来使构建失败:
* What went wrong: org/gradle/api/plugins/MavenPlugin
摇篮版本:8.0.1
gradlew 版本:8.0.1
build.gradle
buildscript {
repositories {
maven {
url uri('https://artifactory.io.thehut.local/artifactory/plugins-release')
}
maven {
url uri('https://repo.spring.io/plugins-release')
}
mavenCentral()
}
ext {
lombokVersion = '1.18.10'
springbootVersion = '2.2.5.RELEASE'
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springbootVersion}")
classpath("com.avast.gradle:gradle-docker-compose-plugin:0.9.2")
classpath("thg:thg-gradle-plugin:1.0.0")
classpath("io.spring.gradle:propdeps-plugin:0.0.10.RELEASE")
classpath("io.spring.gradle:dependency-management-plugin:1.0.7.RELEASE")
classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8")
classpath("org.owasp:dependency-check-gradle:5.3.0")
}
}
plugins {
id 'org.springframework.boot' version '2.2.5.RELEASE'
}
apply from: 'liquibase.gradle'
apply plugin: 'com.thehut.thg-gradle-plugin'
apply plugin: 'org.springframework.boot'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
apply plugin: "io.spring.dependency-management"
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "jacoco"
apply plugin: 'org.sonarqube'
apply plugin: 'org.owasp.dependencycheck'
version = '4.14.16'
jacoco {
toolVersion = "0.8.3"
}
repositories {
maven {
url 'https://artifactory.io.thehut.local:443/artifactory/plugins-release'
}
maven {
url 'https://artifactory.io.thehut.local:443/artifactory/libs-release-local'
}
maven {
url 'https://artifactory.io.thehut.local:443/artifactory/libs-snapshot-local'
}
maven {
url 'http://mhdbld001.ds.thehutgroup.local:8080/artifactory/libs-release'
}
mavenLocal()
mavenCentral()
}
compileJava.dependsOn(processResources)
configurations {
developmentOnly
compileOnly.extendsFrom annotationProcessor
runtimeClasspath.extendsFrom developmentOnly
testIntegrationCompile.extendsFrom testCompileClasspath
testIntegrationRuntime.extendsFrom testRuntime
}
sourceCompatibility = 11
targetCompatibility = 11
dependencies {
def activeMQVersion = '5.15.13'
def awaitilityVersion = '3.1.6'
def camelVersion = '2.25.3'
def commonslang3Version = '3.9'
def ehcacheVersion = '3.7.1'
def guavaVersion = '28.1-jre'
def hikariVersion = '3.3.1'
def httpClientVersion = '4.5.8'
def javaxCacheAPIVersion = '1.1.0'
def javaxRSAPIVersion = '2.0'
def logbackAccessVersion = '2.7.1'
def lombokVersion = '1.18.8'
def metricsSpringVersion = '3.1.3'
def mssqlJdbcVersion = '7.2.2.jre11'
def quartzVersion = '2.3.2'
def themisMonitoringVersion = '1.1.7'
def wiremockVersion = '2.24.0'
def accountServiceInterfaceVersion = '1.179.5'
def catalogueInterfaceVersion = '1.49'
def orderManagerClientInterfaceVersion = '1.351'
def representationVersion = '1.414'
def witnessVersion = '1.2.2'
implementation "com.google.guava:guava:${guavaVersion}",
"com.microsoft.sqlserver:mssql-jdbc:${mssqlJdbcVersion}",
"com.thehutgroup:AccountServiceClientInterface:${accountServiceInterfaceVersion}",
"com.thehutgroup:OrderManagerClientInterface:${orderManagerClientInterfaceVersion}",
"com.thehutgroup:representation:${representationVersion}",
"com.thehutgroup:themismonitoring:${themisMonitoringVersion}",
"com.thehutgroup.witnessservice:WitnessServiceClient:${witnessVersion}",
"com.zaxxer:HikariCP:${hikariVersion}",
"io.micrometer:micrometer-registry-prometheus",
"javax.cache:cache-api:${javaxCacheAPIVersion}",
"javax.ws.rs:javax.ws.rs-api:${javaxRSAPIVersion}",
"net.rakugakibox.spring.boot:logback-access-spring-boot-starter:${logbackAccessVersion}",
"org.apache.activemq:activemq-camel:${activeMQVersion}",
"org.apache.camel:camel-jms-starter:${camelVersion}",
"org.apache.camel:camel-spring-boot-starter:${camelVersion}",
"org.apache.camel:camel-spring-javaconfig:${camelVersion}",
"org.apache.commons:commons-lang3:${commonslang3Version}",
"org.apache.commons:commons-collections4:4.3",
"org.apache.httpcomponents:httpclient:${httpClientVersion}",
"org.ehcache:ehcache:${ehcacheVersion}",
"org.projectlombok:lombok:${lombokVersion}",
"org.quartz-scheduler:quartz-jobs:${quartzVersion}",
'org.springframework.boot:spring-boot-starter-web',
"org.springframework.boot:spring-boot-starter-jdbc",
"org.springframework.boot:spring-boot-starter-cache",
"org.springframework.boot:spring-boot-starter-data-rest",
"org.springframework.boot:spring-boot-starter-actuator",
"org.springframework:spring-oxm"
// implementation dependencies requiring excludes
implementation("com.thehutgroup.catalogue:catalogue-interface:${catalogueInterfaceVersion}") {
exclude group: 'commons-collections', module: 'commons-collections'
}
implementation("com.ryantenney.metrics:metrics-spring:${metricsSpringVersion}") {
exclude group: 'org.springframework', module: 'spring-context-support'
}
implementation("org.apache.activemq:activemq-camel") {
exclude group: 'org.apache.activemq', module: 'activemq-broker'
}
implementation("org.quartz-scheduler:quartz:${quartzVersion}") {
exclude group: 'com.zaxxer', module: 'HikariCP-java7'
}
implementation("org.springframework.boot:spring-boot-starter-activemq") {
exclude group: 'org.apache.activemq', module: 'activemq-broker'
}
// test dependencies
testCompile "org.awaitility:awaitility:${awaitilityVersion}"
testCompile("org.apache.camel:camel-test-spring:${camelVersion}") {
exclude group: 'junit', module: 'junit'
}
testCompile("org.springframework.boot:spring-boot-starter-test") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testCompile("com.github.tomakehurst:wiremock-jre8:${wiremockVersion}") {
exclude group: 'junit', module: 'junit'
}
}
sonarqube {
properties {
property "sonar.host.url", "https://sonarqube.io.thehut.local"
property "sonar.verbose", "true"
property "javax.net.ssl.trustStore", "/etc/pki/java/cacerts"
property "sonar.organization", "logistics-platform"
property "sonar.login", "f9df799f768e2de0fde8c2717a25f64aca1ffa87"
property("sonar.projectName","OrderStateInterface")
property("sonar.projectKey","com.thehutgroup:OrderStateInterface")
}
}
sourceSets {
test {
resources {
srcDirs "src/testIntegration/resources"
}
}
testIntegration {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
resources {
srcDirs "src/testIntegration/resources"
}
}
}
test {
useJUnitPlatform()
testLogging.exceptionFormat = 'full'
}
test.finalizedBy jacocoTestReport
task testIntegration(type: Test) {
description "Runs the integration tests."
group "verification"
useJUnitPlatform()
testClassesDirs = sourceSets.testIntegration.output.classesDirs
classpath = sourceSets.testIntegration.runtimeClasspath
outputs.upToDateWhen { false }
testLogging.exceptionFormat = "full"
}
testIntegration.finalizedBy jacocoTestReport
checkstyleMain.enabled = false
checkstyleTest.enabled = false
checkstyleTestIntegration.enabled = false
findbugsMain.enabled = false
findbugsTest.enabled = false
findbugsTestIntegration.enabled = false
我尝试更新将版本恢复到以前的版本 (4.10.3),但它不会让我返回,因为它在运行构建时会抛出相同的消息。在这一点上,我运行的任何 gradlew 命令都会遇到这条消息。