IDE Configuration

IntelliJ

This IDEA plugin makes it easy to develop Jenkins and its plugins on IntelliJ IDEA

This plugin has the following features:

  • Cmd+B navigation from the Jelly tags to their definitions

  • Error checks and auto completion on attributes and elements of taglibs

  • Syntax error checks on JEXL expressions

  • "Go to stapler view" to jump from a Java class to its views (Cmd+Shift+P)

  • Select a string expression, then "Refactor" > "i18n for Stapler" to create a message resource

Visual Studio Code

Create the following 2 files in your project:

~/.vscode/tasks.json:

{
    "version" : "2.0.0",
    "tasks": [
        {
            "label": "mvnDebug",
            "type": "shell",
            "command": "mvnDebug hpi:run",
            "isBackground": true,
            "problemMatcher": [{
                "pattern": [{
                    "regexp": "\\b\\B",
                    "file": 1,
                    "location": 2,
                    "message": 3
                }],
                "background": {
                    "activeOnStart": true,
                    "beginsPattern": "^.*Preparing to execute Maven in debug mode.*",
                    "endsPattern": "^.*Listening for transport dt_socket at address.*"
                }
            }]
        }
    ]
}

~/.vscode/launch.json:

{
    "configurations": [
        {
            "type": "java",
            "name": "Debug (Attach)",
            "request": "attach",
            "hostName": "localhost",
            "port": "8000",
            "preLaunchTask": "mvnDebug"
        }
    ]
}

F5 to start your debug session.

XSD configuration

If there isn’t a plugin available for your IDE you can manually add the taglib to your IDE.

XML schemas for tag libraries defined in Jelly, stapler, and Jenkins are available. Most modern IDEs and other XML editors can use them to provide auto-completion, which improves your productivity. See Taglibs for links to the up-to date schemas.

References