简体   繁体   English

CircleCI 找不到 gradle。 错误:./gradlew:没有这样的文件或目录

[英]CircleCI cannot find gradle. Error: ./gradlew: No such file or directory

I am working on a project that is developed with Java & Gradle.我正在开发一个使用 Java 和 Gradle 开发的项目。 I want to make it work with CircleCi.我想让它与 CircleCi 一起工作。 I am using the simple CircleCi configuration:我正在使用简单的 CircleCi 配置:

version: 2.1

orbs: 
  gradle: circleci/gradle@2.2.0

workflows:
  checkout-build-test:
    jobs:
      - gradle/test

However, whenever I push the code, I am getting the following error: ./gradlew: No such file or directory但是,每当我推送代码时,我都会收到以下错误: ./gradlew: No such file or directory

The thing is that the root folder of Gradle is not the same as CircleCi.问题是 Gradle 的根文件夹与 CircleCi 不同。 All the java code is stored in a sub folder and not in the main folder.所有 java 代码都存储在子文件夹中,而不是主文件夹中。 Usually, the source code and the CircleCi folders are stored at the same folder's level.通常,源代码和 CircleCi 文件夹存储在同一文件夹的级别。 How can I configure CircleCi to run Gradle from a different folder which is not the main?如何配置 CircleCi 以从非主文件夹的不同文件夹运行 Gradle?

I found the solution to this problem.我找到了解决这个问题的方法。 which is:这是:

version: 2.1

orbs: 
  gradle: circleci/gradle@2.2.0

workflows:
  checkout-build-test:
    jobs:
      - gradle/test:
          app_src_directory: some/folder

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

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