GradleException无法创建ZIP [英] GradleException Could not create ZIP
问题描述
原因: org.gradle.api.GradleException:
无法创建ZIP '/jenkins/repository/workspace/profile/build/libs/../profile.jar'
.
Caused by: org.gradle.api.GradleException:
Could not create ZIP '/jenkins/repository/workspace/profile/build/libs/../profile.jar'
.
Project
common << I build under this directory
profile
build.gradle(in common)
...
dependencies {
compile project(':../profile')
...
settings.gradle(in common)
include '../profile'
它在Windows环境下工作.但是,即使使用 root
帐户
It works on windows environment. But it does not work on linux
environment even using root
account
推荐答案
include
和 project
方法接受的项目路径是逻辑路径,而不是物理路径.它们不能包含 ..
.物理路径必须在 settings.gradle
中单独声明(如果它们从逻辑路径转移了).声明平面物理目录布局的最简单方法是使用 includeFlat
方法:
The project paths accepted by the include
and project
methods are logical paths, not physical paths. They cannot contain a ..
. Physical paths must be declared separately in settings.gradle
(if they divert from the logical path). The easiest way to declare a flat physical directory layout is to use the includeFlat
method:
common/settings.gradle
common/settings.gradle
includeFlat 'profile'
common/build.gradle
common/build.gradle
dependencies {
compile project(':profile')
}
您可以在 Gradle用户指南.
这篇关于GradleException无法创建ZIP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!