How to Add a ClassPath in a Groovy Macro Using the Scripting for Confluence app

Users may not see an error when an incorrect ClassPath is specified in scripting environments such as Groovy macro from the Scripting for Confluence app. This issue can lead to confusion about whether the specified jar files are being used.

Resolution Steps:

  1. Verify the ClassPath:
    Ensure the ClassPath includes the full path to each required jar file. For example:

    /path/to/confluence/WEB-INF/lib/confluence-8.5.5.jar:/path/to/confluence/WEB-INF/lib/core-8.0.1.jar

    An example path:

    /opt/atlassian/confluence/confluence/WEB-INF/lib/com.atlassian.confluence_confluence-8.6.2.jar:/opt/atlassian/confluence/confluence/WEB-INF/lib/com.atlassian.core_atlassian-core-8.0.1.jar

    i.e. add the confluence Jar followed by the core Jar path separated by colon (:) as shown above.

    2024-05-24_11-55-16-20240524-062620.png
  2. Check File Existence:
    Confirm that all jar files listed in your ClassPath actually exist in the specified locations on the server.

  3. Use Multiple Jar Files:
    If multiple jar files are needed, include them in the ClassPath separated by a colon (:).

  4. Testing and Validation:
    Currently, there is no automated validation for the ClassPath field within the macro setup. Manually test the script to ensure it executes as expected, which confirms the ClassPath is correctly set.
    Example output with correct classpath in screenshot below:

    2024-06-02_16-53-56-20240602-112412.png

Â