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.

4

1 回答 1

1

如果你在你的 shell 脚本前加上./,它只会查看当前目录。Invoke gradlew/path1/data-hub/gradlew或者只是gradle(因为您也安装了 Gradle)。

注意:如果您使用 gradle-wrapper (gradlew),则不需要安装 Gradle。Gradle-wrapper 下载 Gradle 本身的独立副本。gradlew 的一个好处是您可以确定 Gradle 的特定版本,并为每个项目单独执行此操作。

于 2019-02-14T08:16:16.273 回答