This plugin allows you to publish build artifacts as attachments to an Atlassian Confluence wiki page.


Global Configuration

First, configure one or more Confluence sites in the global system configuration. If authentication credentials are not supplied, the plugin will act as an anonymous user – as such your Confluence configuration must support anonymous attachments for that to work.

Job Configuration

With at least one site configured, enable the "Publish to Confluence" post-build action, and select from one of the pre-configured Confluence sites. Enter the Space and Page name where the attachment should end up (e.g., for this URL, Space name = "JENKINS", Page name = "Confluence+Publisher+Plugin").

If you have enabled "Archive the artifacts", and wish to automatically upload everything that was archived, check the box labeled "Attach archived artifacts to page". Otherwise, enter an Ant-style fileset pattern to specify which files should be uploaded.

Editing page markup

Please note that as of Confluence v4.0, the page storage format is no longer supporting "wiki format". That makes it slightly more difficult to use simple hidden macros for the replacements. It is still possible, but at the moment it is a bit convoluted and fragile.

In the "Wiki Markup Replacements" section, select the Editor type from the "Add Replacement" dropdown menu. Available Editors include:

Once an editor has been selected, choose the type of markup Generator to use. Available Generators:

You may add multiple markup replacement configurations. However, note that the token-related editors only expect to perform edits once, therefore each replacement configuration should use unique token markers.

If possible, it is recommended to configure two custom User Macros in the Confluence configuration (or have your Confluence administrator configure them):

Sample Confluence 3.x User Macros

These two macros can then be used in the wiki markup, and will not interfere with normal rendering of the wiki content. Additionally, Confluence's "parameter" syntax for user macros allows adding arbitrary parameters to these macros, thus making it very simple to keep the tokens unique. Some examples:

If you choose not to use a confluence macro as the token, it will still work (e.g., you can something else, like "%%INSERT_AFTER%%"). However, that text may appear in the rendered markup. For that reason, using the Confluence macro is the recommended approach.

Sample Confluence 4.x User Macros

It's then important to realize that you don't have the same control over the markers as you did in Confluence 3.x, and the marker you used previously will not work in the editor configuration. To know what text to use for the "marker" locations, you'll need to insert the macros in their proper locations, and then view the underlying storage format. These are the analogous examples that correspond to the same examples given above for the Confluence 3.x versions:

Here's an example of what it might look like while in Edit mode:


Version 2.0.2 (July 30, 2018)

Version 1.8 (Jan 14, 2013)

Version 1.7.1 (Jun 25, 2012)

Version 1.6 (May 29, 2012)

Version 1.5 (Apr 27, 2012)

Version 1.4 (Jan 11, 2012)

Version 1.3 (Oct 17, 2011)

Version 1.2 (Oct 16, 2011)

Version 1.1.1 (Sep 22, 2011)

Version 1.1 (Jul 2, 2011)

Version 1.0.3 (Jun 19, 2011)

Version 1.0.2 (Jun 18, 2011)

Version 1.0.1 (Mar 24, 2011)

Version 1.0.0 (Feb 28, 2011)