简体   繁体   English

SAP Cloud Platform 集成添加依赖项

[英]SAP Cloud Platform Integration add dependencies

I need to use the @Grab in a Groovy script in SAP Cloud Platform Integration and it gives an error ClassNotFoundException: org.apache.ivy.core.report.ResolveReport .我需要在 SAP Cloud Platform Integration 的 Groovy 脚本中使用 @Grab,它给出了一个错误 ClassNotFoundException: org.apache.ivy.core.report.ResolveReport 。 Is there a way I can add this kind of dependency or can I load a jar on CPI in another way?有没有办法可以添加这种依赖项,或者我可以以另一种方式在 CPI 上加载 jar 吗?

old thread, but basically you download the .jar (just google it) and upload it in the SAP CPI process.旧线程,但基本上您下载 .jar(只需 google)并将其上传到 SAP CPI 流程中。 Just add it under Resources for the flow as an archive.只需将其作为存档添加到流的资源下。

Then you just import it like all other libaries.然后,您只需像所有其他库一样导入它。 For example you can download Apache Commons Text 1.9 here: https://commons.apache.org/proper/commons-text/download_text.cgi (get the zip, extract the .jar, upload it in SAP CPI resource).例如,您可以在此处下载 Apache Commons Text 1.9: https : //commons.apache.org/proper/commons-text/download_text.cgi (获取 zip,解压缩 .jar,将其上传到 SAP CPI 资源中)。

Then in your groovy script, just leave out the @grab and only do the import - for example: import org.apache.commons.text.StringEscapeUtils;然后在您的 groovy 脚本中,只需省略 @grab 并只进行导入 - 例如: import org.apache.commons.text.StringEscapeUtils;

That means you don't have ivy-XXX.jar in the classpath.这意味着您在类路径中没有ivy-XXX.jar

This library included into full groovy package, but it's not in the groovy-all-XXX.jar that is mainly used for groovy-enabled applications.这个库包含在完整的 groovy 包中,但它不在主要用于支持 groovy 的应用程序的groovy-all-XXX.jar中。

Just take ivy-XXX.jar from groovy package or download from maven central and put into classpath of your application/server.只需从 groovy 包中获取ivy-XXX.jar或从maven central下载并放入应用程序/服务器的类路径中。

hopefully, it will work希望它会起作用

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

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