gradle 构建失败,出现异常
gradle build failed with exception
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/"
}
}
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/"
}
}