【问题标题】:ClassNotFoundException is thrown when trying to grab groovy-ssh plugin with Grape尝试使用 Grape 抓取 groovy-ssh 插件时抛出 ClassNotFoundException
【发布时间】:2016-03-16 16:44:27
【问题描述】:

当我简单地用 Grape 抓取 groovy-ssh 插件时,会引发异常。我使用这里的代码:https://github.com/int128/groovy-ssh

@Grab('org.hidetake:groovy-ssh:1.5.0')
@Grab('ch.qos.logback:logback-classic:1.1.2')
def ssh = org.hidetake.groovy.ssh.Ssh.newService()
println "Test"

BUG! exception in phase 'conversion' in source unit 'delete.groovy' # Licensed to the Apache Software Foundation (ASF) under one or more
Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more

有人看到这个错误吗?

【问题讨论】:

    标签: groovy ssh


    【解决方案1】:

    这是因为 groovy-ssh 中的 transitive dependency on groovy-all

    修复它:

    @Grab('org.hidetake:groovy-ssh:1.4.0')
    @GrabExclude('org.codehaus.groovy:groovy-all')
    @Grab('ch.qos.logback:logback-classic:1.1.2')
    def ssh = org.hidetake.groovy.ssh.Ssh.newService()
    println "Test"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-13
      • 1970-01-01
      • 2021-04-19
      相关资源
      最近更新 更多