无法在 karate maven 项目的另一个模块中调用实用程序

Unable to call utilities in another module of karate maven project

当我尝试从具有日志的不同模块调用另一个模块的功能文件时出现以下异常, org.graalvm.polyglot.PolyglotException: TypeError: Access to host class utils.Utils is not allowed or does not exist.

以下是我试图运行的文件, https://github.com/bipin-k/karate-automation/blob/master/sample-automation/src/main/java/sample.feature

https://github.com/bipin-k/karate-automation

karate error description

请阅读此答案以获取有关如何处理跨 Java 模块重用的提示:

建议尽量避免。 call read('../../../../core-utilities/src/main/java/java-functions-calls.feature') 之类的事情会导致无法维护的测试:

问题很可能是因为在您制作 call 的项目中 - utils.Utils class 只是 而不是 Java“class路径”。您可能应该寻求了解 Java 的人的帮助,或者坚持使用更简单的“单一模块”Java 项目。