Is it possible to connect to jenkins instance to get the available libraries (including the ones from plugins) for locally developing groovy scripts with code completion in intellij or vscode?
It is not possible to have the same library as that of Jenkins instance to compile groovy inside these IDE'S.
Instead you need to have Groovy SDK installed and configured for each of there IDEs separately. (IntelliJ is simple to configure while VS Code usages .json file for all configuration). Once you have the Groovy SDK lib configured, within IDE project you can compile and run the sample .groovy (And or .gdsl) script (without any jenkins plugin).
If you are trying to trigger .jenkinsfile then, you need to change configuration in IDE to treat .jenkinsfile equal to .groovy file see below screenshot.
While it is possible to configure your Jenkins instance into IDE and also to control (Run, cancel and re-run) the jobs directly remotely in runtime from IntelliJ or from VS Code. For this you can use;
Jenkins-Control-Plugin - IntelliJ IDEA
Jenkins Jack(many other plugins are available but this is most popular) - VS Code.
Jenkins Runner - VS Code
My favorite is VS code with Jenkins Jack simple and effective.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With