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

399 Views Asked by At

I am working on a project that is developed with Java & Gradle. I want to make it work with CircleCi. I am using the simple CircleCi configuration:

version: 2.1

orbs: 
  gradle: circleci/[email protected]

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

The thing is that the root folder of Gradle is not the same as CircleCi. All the java code is stored in a sub folder and not in the main folder. Usually, the source code and the CircleCi folders are stored at the same folder's level. How can I configure CircleCi to run Gradle from a different folder which is not the main?

1

There are 1 best solutions below

0
On BEST ANSWER

I found the solution to this problem. which is:

version: 2.1

orbs: 
  gradle: circleci/[email protected]

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