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.
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.
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):
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.
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:
Skip to end of metadata Go to start of metadata