MissingMethodException是什么意思?

时间:2018-03-21 15:57:57

标签: java jenkins groovy manifest missingmethodexception

我从presentation on Continuous Delivery中提取了它 它应该创建,读取和更新清单。 我只能运行一次。

def writePropertiesFile( props, file ) {
    writeFile file: file, text: writeProperties(props)
}
@NonCPS def writeProperties( props ){
    def sw = new StringWriter()
    props.store( sw, null )
    return sw.toString()
}
node() {
    stage( 'Reading manifest' ) {
        try{
            copyArtifacts filter: 'manifest', 
                fingerprintArtifacts: true, 
                projectName: env.JOB_NAME, 
                selector: lastSuccessful()
            versions = readProperties( file: 'manifest' )
        } catch( Exception e ) {
            echo e.toString()
            versions = new Properties()
        }
    }
    stage( 'Merging manifest' ) {
        versions.put( 'dev', '1.2.3' )
    }
    stage( "Writing manifest" ) {
        writePropertiesFile( versions, 'manifest' )
        archive 'manifest'
    }
}

第一次正常工作。

它会创建一个这样的清单

#Wed Mar 21 16:30:34 CET 2018
dev=1.2.3

第二次,当我想更新清单时,我收到此错误: hudson.remoting.ProxyException:groovy.lang.MissingMethodException:没有方法签名:java.util.HashMap.store()适用于参数类型:(java.io.StringWriter,null)values:[,null]

我绝对不是Java编码器,我已经看到了一些关于这个MissingMethodException的问题,我还没有理解。例如how to fix groovy.lang.MissingMethodException: No signature of method:

0 个答案:

没有答案
相关问题