Jenkins Pipeline NotSerializableException: groovy.json.internal.LazyMap

Use JsonSlurperClassic instead. Since Groovy 2.3 (note: Jenkins 2.7.1 uses Groovy 2.4.7) JsonSlurper returns LazyMap instead of HashMap. This makes new implementation of JsonSlurper not thread safe and not serializable. This makes it unusable outside of @NonDSL functions in pipeline DSL scripts. However you can fall-back to groovy.json.JsonSlurperClassic which supports old behavior and could be … Read more

Is it possible to capture the stdout from the sh DSL command in the pipeline

Now, the sh step supports returning stdout by supplying the parameter returnStdout. // These should all be performed at the point where you’ve // checked out your sources on the slave. A ‘git’ executable // must be available. // Most typical, if you’re not cloning into a sub directory gitCommit = sh(returnStdout: true, script: ‘git … Read more

Jenkins scripted pipeline or declarative pipeline

When Jenkins Pipeline was first created, Groovy was selected as the foundation. Jenkins has long shipped with an embedded Groovy engine to provide advanced scripting capabilities for admins and users alike. Additionally, the implementors of Jenkins Pipeline found Groovy to be a solid foundation upon which to build what is now referred to as the … Read more

Configuring Groovy SDK within IntelliJ IDEA

IntelliJ IDEA expects the standard Groovy SDK layout which is provided with the official distributions available at https://groovy.apache.org/download.html. Just download, unpack into any directory, specify this directory as the library home. Homebrew package layout may be different, however it may have the standard layout in the libexec subdirectory in some cases. Try /usr/local/opt/groovy/libexec (use Cmd … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)