0

MarkLogic version - 9.0-6.2 Gradle version - 4.5.1

We have a linux batch server where data hub, mlcp, gradle are deployed.

Location of datahub folder is /path1/data-hub. This is where I have data hub components (plugins, user-config etc. along with gradle files like gradlew, gradle.bat etc)

Location of my bash scripts is /path1/scripts/data-hub

Location where gradle is unpacked is /path2/gradle/gradle-4.5.1. This is where the bin directory is located that has gradle and gradle.bat files (gradlew does not exist under bin)

I have a PATH variable created at '/path2/gradle/gradle-4.5.1/bin' and also at /path1/data-hub (where data hub is setup and gradlew file exists)

When I execute below code from a bash script placed at /path1/data-hub, the harmonization flow is running fine.

./gradlew hubRunFlow -PentityName="test" -PflowName="test-harmonize- 
process" -PflowType="harmonize" -PenvironmentName=dev

However, when I place the exact same script at /data/scripts/data-hub, the flow is not running.

 ./gradlew: No such file or directory.

I tried running the code by removing ./ before gradlew but still getting error 'gradlew command not found'

Any help is highly appreciated.

Bhanu
  • 427
  • 2
  • 8
  • if `gradlew` is in `/path1/data-hub` seems like you just need to add `/path1/data-hub` to your `$PATH`? – chiliNUT Feb 14 '19 at 05:24

1 Answers1

1

If you prefix your shell script with ./, it will look at the current directory only. Invoke gradlew, /path1/data-hub/gradlew or just gradle (since you installed Gradle as well) instead.

Note: you don't need to install Gradle if you are using gradle-wrapper (gradlew). Gradle-wrapper downloads an isolated copy of Gradle itself. One benefit of gradlew is that you can pin down on a specific version of Gradle, and do so for each project separately.

HTH!

grtjn
  • 20,254
  • 1
  • 24
  • 35