ShadyBears
ShadyBears

Reputation: 4185

gradle build failed with exception

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 dependency has a dependency that is no longer available in maven repository

org.freemarker version 2.3.26 https://mvnrepository.com/artifact/org.freemarker/freemarker

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

FAILURE: Build failed with an exception.

I've never ran into this issue before. What do I do in this situation?

Upvotes: 1

Views: 1253

Answers (1)

Andrey Vetlugin
Andrey Vetlugin

Reputation: 1068

Your dependency tree contains this transitive dependency: org.freemarker:freemarker:2.3.26.jbossorg-1, which is not found in Maven Central. The reason it does not exist in Maven Central is that it is not the normal version of freemarker, but a JBoss patched version, which can be seen from the version of the dependency 2.3.26.jbossorg-1.

Googling for org.freemarker:freemarker:2.3.26.jbossorg-1 took me to this Maven repository: https://repository.jboss.org/nexus/content/groups/public/

The solution would be to add this Maven repository to your build.gradle like this:

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/"
    }
}

Upvotes: 3

Related Questions