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
失败:生成失败,发生异常。
构建文件'C:\ Users \ kona \ IdeaProjects \ com-CustomWIH \ build.gradle'行:21
无法确定任务':fatJar'的依赖性。
Could not resolve all files for configuration ':compile'. Could not find org.freemarker:freemarker:2.3.26.jbossorg-1. Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/freemarker/freemarker/2.3.26.jbossorg-1/freemarker-2.3.26.jbossorg-1.pom
- https://repo.maven.apache.org/maven2/org/freemarker/freemarker/2.3.26.jbossorg-1/freemarker-2.3.26.jbossorg-1.jar Required by: project : > org.jbpm:jbpm-kie-services:7.20.0.Final
我以前从未遇到过这个问题。在这种情况下我该怎么办?
最佳答案
您的依赖关系树包含此传递依赖关系: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/"
}
}
关于gradle - gradle构建失败,出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55801072/