原因:org.gradle.api.GradleException:
无法创建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
帐户,它也无法在 linux
环境下工作
最佳答案
include
和 project
方法接受的项目路径是逻辑路径,而不是物理路径。它们不能包含 ..
。物理路径必须在 settings.gradle
中单独声明(如果它们从逻辑路径转移)。声明平面物理目录布局的最简单方法是使用 includeFlat
方法:
通用/settings.gradle
includeFlat 'profile'
通用/build.gradle
dependencies {
compile project(':profile')
}
您可以在 Gradle User Guide 的“多项目构建”一章中找到有关此主题的更多信息。 .
关于GradleException 无法创建 ZIP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16786818/