gradle构建失败,异常

问题描述 投票:1回答:1

enter image description here

apply plugin: 'java'

group 'com.CustomWIH'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}


dependencies {
    compile 'org.jbpm:jbpm-kie-services:7.20.0.Final'
}

task fatJar(type: Jar) {
    baseName='jbpmTutorial'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}

jbpm依赖项具有maven存储库中不再可用的依赖项

org.freemarker版本2.3.26 https://mvnrepository.com/artifact/org.freemarker/freemarker

C:\ Users \ kona \ IdeaProjects \ com-CustomWIH> gradle fatJar --stacktrace

FAILURE:构建因异常而失败。

我以前从未遇到过这个问题。在这种情况下我该怎么办?

gradle build.gradle maven-central
1个回答
3
投票

您的依赖树包含这个传递依赖:org.freemarker:freemarker:2.3.26.jbossorg-1,它在Maven Central中找不到。它在Maven Central中不存在的原因是它不是freemarker的正常版本,而是JBoss修补版本,可以从依赖2.3.26.jbossorg-1的版本中看出。

谷歌搜索org.freemarker:freemarker:2.3.26.jbossorg-1带我到这个Maven存储库:https://repository.jboss.org/nexus/content/groups/public/

解决方案是将这个Maven存储库添加到build.gradle中,如下所示:

repositories {
    mavenCentral()
    maven {
        url "https://repository.jboss.org/nexus/content/groups/public/"
        // OR this one, as suggested by jb-nizet
        // url "https://maven.repository.redhat.com/ga/"
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.