groovydependenciesclassnotfoundexceptionsap-business-technology-platformsap-cpi

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 .

Is there a way I can add this kind of dependency or can I load a jar on CPI in another way?


Solution

  • old thread, but basically you download the .jar (just google it) and upload it in the SAP CPI process. 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).

    Then in your groovy script, just leave out the @grab and only do the import - for example: import org.apache.commons.text.StringEscapeUtils;