简体   繁体   English

无法在git仓库中为Gradle子文件夹配置Jenkins作业。 这在Maven中起作用

[英]Could not able to configure Jenkins job for Gradle subfolder in git repository. This works in Maven

I have a Git repository with multiple projects say A, B and C. Each of these projects are built separately with their own settings.gradle files. 我有一个包含多个项目(例如A,B和C)的Git存储库。每个项目都分别使用自己的settings.gradle文件构建。 These projects have sub modules. 这些项目具有子模块。 The root of the repository does not contain any gradle files. 存储库的根目录不包含任何gradle文件。

For maven I configured the Root Pom in Jenkins as A/pom.xml . 对于Maven,我在Jenkins中将Root Pom配置为A / pom.xml And this works. 这可行。

For gradle I am providing tasks as 对于gradle,我正在提供任务
:A:clean A:清洁
:A:build A:打造
:A:test :一个测试

This is failing with below error: 这失败并显示以下错误:

FAILURE: Build failed with an exception. 失败:构建失败,发生异常。

  • What went wrong: Project 'A' not found in root project 'Job Name'. 出了什么问题:在根项目“作业名称”中找不到项目“ A”。

I think first you should change the path to project root where gradlew file exists (inside "A") And then run the required commands: 我认为您首先应该将路径更改为存在gradlew文件的项目根目录(在“ A”内部),然后运行所需的命令:

cd \A
gradlew clean
gradlew assemble

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM