mule - 无法为 GROOVY 脚本解析类 org.ajoberstar.grgit.Grgit
问题描述
我试图运行下面的代码片段,但它返回了上面的异常
import org.ajoberstar.grgit.Grgit
import org.ajoberstar.grgit.Credentials
def grgit = Grgit.clone(dir: 'path/to/dir', url: 'git/uri/here')
grgit.close()
任何可能的解决方案?
解决方案
此流程有效:
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="util-testFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/clone" doc:name="HTTP"/>
<scripting:component doc:name="Groovy">
<scripting:script engine="Groovy"><![CDATA[import org.ajoberstar.grgit.Grgit
import org.ajoberstar.grgit.Credentials
def grgit = Grgit.clone(dir: 'test', uri: 'https://github.com/rmccue/test-repository.git')
grgit.close()]]></scripting:script>
</scripting:component>
</flow>
只要您的 pom.xml 中有以下内容:
<!-- https://mvnrepository.com/artifact/org.ajoberstar/grgit -->
<dependency>
<groupId>org.ajoberstar</groupId>
<artifactId>grgit</artifactId>
<version>1.7.0</version>
</dependency>
推荐阅读
- reactjs - Shopify 公共应用中的 Google Analytics(分析)实施
- autodesk-forge - API :urn/metadata/:guid/properties 响应“属性 JSON 的大小太大,请通过对象 id 查询调用此 API”
- google-apps-script - 使用 getFileById 时出现异常:无效 ID 错误
- flutter - 未处理的异常:键入“列表”
' 不是类型 'List 的子类型 - python - 如何使用 resquest.get 检索大数据
- r - ggplot2 不应该按字母顺序排列条形图吗?
- python - 如何在 selenium webdriver Python 中用鼠标单击第二层元素?
- angular - 来自订阅的 Angular Return Observable
- yocto - 在 yocto 上安装 tokbox 时出现 QA 错误
- python - 将 pandas 数据帧导出到 csv 会导致随机换行