Configuration

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:

Entire Page
Entire page content is replaced. No markers required.

Prepend
Content is added to the very beginning of the page. No markers required.

Append
Content is added to the very end of the page. No markers required.

Before Token
Content is inserted before a configurable marker token. Requires one marker.

After Token
Content is inserted after a configurable marker token. Requires one marker.

Between Tokens
Content is inserted between two configurable start/end marker tokens. Existing content between the tokens is replaced. Requires a start and end marker.

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

Plain Text
Content is entered into a textarea field. The content should be valid wiki markup. Build variables will be expanded.

File Contents
Enter a filename to pull markup contents from. The file should exist relative to the workspace directory, and should contain plain-text markup. Build variables will be expanded.

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:

{jenkins-marker:before|section=foo}

{jenkins-marker:after|section=changelog}

{jenkins-between:start|section=log}This will be replaced.{jenkins-between:end|section=log}

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:

Version 1.3 (Oct 17, 2011)

Adds a new "Replace entire page" editor, which was previously only possible with the "Replace between tokens" editor, and placing the start/end tokens at the top/bottom of the page content.

Version 1.2 (Oct 16, 2011)

issue #11276 Fixes file attachments when working against a Confluence 4.0 server. Also fails gracefully if content editors are configured for a 4.0 server. Both features still work properly on Confluence 3.x, but content editing is disabled for version 4.0+.

Version 1.1.1 (Sep 22, 2011)

Fix a Content-Type issue that prevented attachments to Confluence, by defaulting to application/octet-stream if unable to figure out the content type automatically.

Great plugin! However, not support attach doc/docx files yet? (or, miss some...

Great plugin! However, not support attach doc/docx files yet? (or, miss some SOAP or Content-Type configuration?)

I want use it to publish doc files to Confluence, but it will get an error: "Content type cannot be null or empty".
How should i solve the problem?

BTW: the error stack from jenkins console:

[confluence] Uploading attachments to Confluence page: http://192.168.0.147/display/MEDIA/MASManuals
[confluence] Evaluating fileset pattern: Manuals/*.doc
[confluence] Found 3 workspace artifact(s) to upload to Confluence...
[confluence] Uploading 3 file(s) to Confluence...
[confluence] - Uploading file: FMS安装配置指南.doc (null)
ERROR: Unable to upload file...
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalArgumentException: Content type cannot be null or empty.
faultActor:
faultNode:
faultDetail:
{}faultData:null
{http://xml.apache.org/axis/}hostname:dev4-codesrv
java.lang.IllegalArgumentException: Content type cannot be null or empty.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at hudson.plugins.confluence.soap.ConfluenceserviceV1SoapBindingStub.addAttachment(ConfluenceserviceV1SoapBindingStub.java:4519)
at com.myyearbook.hudson.plugins.confluence.ConfluenceSession.addAttachment(ConfluenceSession.java:123)
at com.myyearbook.hudson.plugins.confluence.ConfluenceSession.addAttachment(ConfluenceSession.java:144)
at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performAttachments(ConfluencePublisher.java:217)
at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.perform(ConfluencePublisher.java:251)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:693)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:668)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:646)
at hudson.model.Build$RunnerImpl.post2(Build.java:162)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:615)
at hudson.model.Run.run(Run.java:1401)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:230)

Interesting you brought this up so recently – we just started seeing the s...

Interesting you brought this up so recently – we just started seeing the same thing happen shortly after an upgrade to 1.430 (not sure if a Confluence upgrade also occurred during that timeframe). I know our jobs were previously working to post an iPhone "*.ipa" file, and after the upgrade to 1.430, that stopped working (with the same soap fault you quoted above).

I just released a fix to fallback to application/octet-stream if it can't figure out the content type (very primitive – it tries to guess the content type from the filename extension.. didn't think it was really necessary to do full content inspection to try to nose out proper content types).

Version 1.1.1 should show up in the maven repository and update center in the next 12-24 hours.

Try manually refreshing from the Jenkins update manager. The block that you see...

Try manually refreshing from the Jenkins update manager. The block that you see at the top of this page is pulled directly from the plugin repository, so version 1.1.1 is definitely in the repository. I was able to update our production instance, and Shen Liu reports above that he was able to update as well.

Hello
I am currently trying to post a little post to my confluence site b...

Hello

I am currently trying to post a little post to my confluence site but it doesnt work because jenkins always tries to post as anonymus user. The Connection in Global Settings with the right username and password is succesful by check login. Is there any other hint to force jenkins to use the supplied username and password or any option in confluence which has to be enabled?

I'd like to post to a site when the build fails too. If this plugin could do that, it could replace setting up email lists (since users can choose to subscribe to a page). Without a fail notification, you can't tell if the build is still working or if it failed. It would be great if it could use tokens like the email-ext supplies (like $BUILD_STATUS).

Off the top of my head, there is one case where your request may become problematic: for people who don't use the hidden macro approach for the marker tokens, someone may choose something like, e.g., $$SECTION1$$, and that may be inappropriately interpreted as an environment variable. I'll have to think about it, and the best way to implement that. That's why it'll be better to track progress on that in JIRA, instead of in the comments here

I'll tried to use your plugin and configured it like described here. With conflu...

I'll tried to use your plugin and configured it like described here. With confluence 4.1 (the newest version of jenkins and the plugin installed) I'm faced with the following exception. Any ideas, what went wrong?

[confluence] Uploading attachments to Confluence page: http://localhost:1990/confluence/display/PLU/Home
ERROR: Publisher com.myyearbook.hudson.plugins.confluence.ConfluencePublisher aborted due to exception
java.lang.NullPointerException
at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.findArtifacts(ConfluencePublisher.java:402)
at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performAttachments(ConfluencePublisher.java:170)
at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.perform(ConfluencePublisher.java:291)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:675)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:653)
at hudson.model.Build$RunnerImpl.post2(Build.java:162)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:622)
at hudson.model.Run.run(Run.java:1434)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Finished: FAILURE

Hmm, that line is trying to search for files in the artifacts directory. Are yo...

Hmm, that line is trying to search for files in the artifacts directory. Are you not archiving any artifacts in the job? I wonder if that's because you have "upload archived artifacts" checked, but you don't have "archive the artifacts" configured... I'll look into that, but please try enabling/disabling those two options, to see if it fixes it. If it does, please use the JIRA issue tracker to report the bug: https://issues.jenkins-ci.org/secure/CreateIssue.jspa?pid=10172&issuetype=1&Create=Create (component = "confluence-publisher")

stackTrace:java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:360) at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at jenkins.plugins.confluence.soap.v1.ConfluenceserviceV1SoapBindingStub.login(ConfluenceserviceV1SoapBindingStub.java:4619) at com.myyearbook.hudson.plugins.confluence.ConfluenceSite.createSession(ConfluenceSite.java:89) at com.myyearbook.hudson.plugins.confluence.ConfluenceSite$DescriptorImpl.doLoginCheck(ConfluenceSite.java:149) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477) at org.kohsuke.stapler.Stapler.service(Stapler.java:159) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:249) at winstone.RequestDispatcher.forward(RequestDispatcher.java:335) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:52) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:153) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:131) at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:73) at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:69) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:61) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) at java.lang.Thread.run(Thread.java:662)

Unknown macro: {http}

hostname:hudson-blr.ap.rsa.net
java.net.ConnectException: Connection timed out at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at jenkins.plugins.confluence.soap.v1.ConfluenceserviceV1SoapBindingStub.login(ConfluenceserviceV1SoapBindingStub.java:4619) at com.myyearbook.hudson.plugins.confluence.ConfluenceSite.createSession(ConfluenceSite.java:89) at com.myyearbook.hudson.plugins.confluence.ConfluenceSite$DescriptorImpl.doLoginCheck(ConfluenceSite.java:149) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648) at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477) at org.kohsuke.stapler.Stapler.service(Stapler.java:159) at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) at winstone.ServletConfiguration.execute(ServletConfiguration.java:249) at winstone.RequestDispatcher.forward(RequestDispatcher.java:335) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95) at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:52) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:153) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:131) at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:73) at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:69) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:61) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at winstone.FilterConfiguration.execute(FilterConfiguration.java:195) at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368) at winstone.RequestDispatcher.forward(RequestDispatcher.java:333) at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(SSLSocketImpl.java:360) at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) ... 76 more

Failed to login

AxisFault

faultCode:

Unknown macro: {http}

Server.userException

faultSubcode:

faultString: java.net.ConnectException: Connection timed out

faultActor:

faultNode:

faultDetail:

Unknown macro: {http}

stackTrace:java.net.ConnectException: Connection timed out

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)

at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

at java.net.Socket.connect(Socket.java:529)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:360)

at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)

at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)

at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)

at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

at org.apache.axis.client.Call.invokeEngine(Call.java:2784)

at org.apache.axis.client.Call.invoke(Call.java:2767)

at org.apache.axis.client.Call.invoke(Call.java:2443)

at org.apache.axis.client.Call.invoke(Call.java:2366)

at org.apache.axis.client.Call.invoke(Call.java:1812)

at jenkins.plugins.confluence.soap.v1.ConfluenceserviceV1SoapBindingStub.login(ConfluenceserviceV1SoapBindingStub.java:4619)

at com.myyearbook.hudson.plugins.confluence.ConfluenceSite.createSession(ConfluenceSite.java:89)

at com.myyearbook.hudson.plugins.confluence.ConfluenceSite$DescriptorImpl.doLoginCheck(ConfluenceSite.java:149)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)

at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)

at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)

at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)

at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)

at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)

at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234)

at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)

at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:563)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:648)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)

at org.kohsuke.stapler.Stapler.service(Stapler.java:159)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)

at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)

at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)

at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)

at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)

at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:52)

at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)

at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:153)

at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:131)

at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:73)

at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:69)

at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)

at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)

at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)

at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)

at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)

at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)

at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)

at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:61)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)

at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)

at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)

at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)

at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)

at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)

at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)

at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)

at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)

at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)

This means your Jenkins server is unable to communicate with the Confluence serv...

This means your Jenkins server is unable to communicate with the Confluence server. Have you tried over http instead of https? Try connecting to the Jenkins server, and attempt to use "curl" or "wget" to fetch content from the Confluence server. If that is not working, then that's something you'll need to figure out – I can't really help diagnose that.

I like this plugin,since it makes sense to me to leave a "Deployment Note" autom...

I like this plugin,since it makes sense to me to leave a "Deployment Note" automatically for a new deployment to a production server made by jenkins.

I'm using the plugin to prepend the "Deployment Note" to a server specific confluence page but I'm missing some Variables, which woud make it even more useful. Maybe I just missed the documentation or hints about what variables are available.

What I would like to know: Are there variables which contain the Maven Artifact-Infos from the POM, e.g. Version, Group-Id, Artifact-Id etc? Is there a variable for the "pure" build date? What I found ist the Jenkins-Build-Variable $BUILD_ID which contains the String-Verison of the date and time.

A really great feature would also be to post some kind of "changes since version x"-list. For that one would need some more infos from the SCM (mine is subversion) of that build in a variable.

Glad you like it Wolfgang. To address some of your questions:
Are there variab...

Glad you like it Wolfgang. To address some of your questions:

Are there variables which contain the Maven Artifact-Infos from the POM, e.g. Version, Group-Id, Artifact-Id etc?

I don't know the answer to this, because I don't generally use Maven projects. You might need to make a custom Maven plugin that can generate these things for you automatically, and output it to a file. Wish I could help you more on this, but I'm just not familiar with how Maven works (writing this Jenkins plugin is the first time I've ever used maven)

Maybe I just missed the documentation or hints about what variables are available.

Well, there is really only one hint for this that I have seen, and it is far from complete:
http://ci.jenkins-ci.org/env-vars.html
Many plugins can add more variables at run-time, but not all plugins explain in full detail which variables are available to you.. so in some cases you might just need to run a test for yourself, to see everything that is available.

A simple test for that would be to somehow get the build step you're working with to do a dump of all environment variables. For example, if you have an "Execute Shell" build step, you can dump environment variables by simply running the command set, which will dump all environment variables available at that time. Or for your case, perhaps make a test Maven POM project that just dumps the environment variables there. Again I don't usually work with Maven projects in Jenkins, so I can't really point you to some help for that.

Is there a variable for the "pure" build date?

You found $BUILD_ID already, which is also described at the env-vars page: The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
If that is not enough for you, you may need to manually generate this string as part of your build process, or as a separate build step in your job. For example, you could have a separate "Execute Shell" build step that just dumps the date into a kind of "release notes" file:

date >> "${WORKSPACE}/release-notes.txt"

A really great feature would also be to post some kind of "changes since version x"-list. For that one would need some more infos from the SCM (mine is subversion) of that build in a variable.

I believe there is a "Release Notes" type plugin for Jenkins that can do this for you automatically (like what is displayed in the "Changes" page in Jenkins already). Another option is if you tag releases with version identifiers, you can use something like this (this is specific to the Git SCM, but there's probably a similar technique for other SCMs):

Unfortunately, that is not in the scope of this plugin, since this plugin already allows you to export everything you want into a single XHTML file (for Confluence 4.x; or text file containing wiki markup, for Confluence 3.x), and then use the "File contents" option for the Content Generator. So the first step would be getting a build step into your project that is able to create compatible confluence markup containing all the information you want – and then simply use that markup file in the Confluence Publisher plugin configuration.

Hi,
what are the Between Tokens for confluence 4.x
I don't really get out...

Hi,

what are the Between Tokens for confluence 4.x

I don't really get out of the documentation, where to find them. I created the macro like above and I can't figure out what to write in Jenkins for the start and end token. It works if I write in my confluence between box "start end" and then put this in jenkins, but I doubt that this is the way.

Parent is not one of the options for this. That would need to be a new feature ...

Parent is not one of the options for this. That would need to be a new feature request. See the issue tracker link above if you'd like to submit this My time is limited due to $dayJob, but I do try to address useful requests, and am also always open to accepting pull requests.

Hmm, that is odd behavior... The main problem is that your "Marker Token" is si...

Hmm, that is odd behavior... The main problem is that your "Marker Token" is simply "start". The way the token editors works is it simply looks for that string within the raw XHTML markup of the page (as of Confluence 4 ... wiki markup in Confluence 3). So to use the Confluence 4 token editors, you have to use the resulting XHTML that is produced by inserting the placeholder token markers. E.g., in your example, the token "start" should instead be:

Even in the Confluence 3 wiki markup style, you would have needed more than just "start" in the token field, as seen in the configuration section of this page:

{jenkins-marker:after|id=start}

The reason it does a simple string check is so if you do not have access to create Confluence macros like the ones mentioned above, you could still do a rudimentary token, such as "%%START%%". That token appears inside the page though, which is why I recommend using the Confluence macros as markers (requires admin access to Confluence).

Hi!
This is the point that I don't understand clearly.
The Confluence admi...

Hi!

This is the point that I don't understand clearly.

The Confluence administrator has created the Confluence macros. And the markers are created using these Macro (you can see that the markers are named "Jenkins Token Marquers").

I'm creating these macro using the "wiki markup" insertion. It just ask for an id. And insert the tag as you can see on the screenshot.

And don't understand how tu use the following notation:<p><ac:macro ac:name="jenkins-marker"><ac:parameter ac:name="id">start</ac:parameter></ac:macro></p>Do I have to use a specific mode of page editing ?

There are 3 steps:
1. Creating the macro for the tokens (your admin has already ...

There are 3 steps:
1. Creating the macro for the tokens (your admin has already done this)
2. Inserting the tokens into your page in the places you want the edits to appear (you've done this)
3. Specifying the token to use for whatever editor type you want to use (in your case, you're choosing the "insert after" editor, but the token you've entered is incorrect)

For #3, you need to use the correct macro based on the version of Confluence you are using. You're using Confluence 4, so you have to use the XHTML version of the macro as your "token". You can see what the XHTML representation is of your macro by going to Tools > View Storage Format in the top-right Tools menu of your page. The popup that appears will show the raw XHTML markup for your page. For example, this is a token that I've inserted with id=after-changelog:

Now when I go to View Storage Format for that page, in place of the "after-changelog" macro, I see this:

That is what I would enter into my Jenkins job configuration in order to have the edits inserted after the "after-changelog" marker. The only thing that changes is the "after-changelog" part, the rest is predictable (this is for the single token macro... The between-tokens macro looks a little bit different, and you can see that difference in the Configuration section above, for Confluence 4.x).

I know this is confusing, and it's mostly due to the change in storage format introduced in Confluence 4. I've been wanting to make that a bit more intuitive in the configuration, but unfortunately I can't guarantee that everyone is using the same macro for these tokens. The most portable way to do this is by using the raw wiki markup, since that's how the replacements will be made to the content.

Just remember that what matters most is the "View Storage Format" representation of your page. Wherever you want the text to appear, use that markup verbatim to indicate the markers in the Jenkins config.

Hi Kevin, thanks for using it and for bringing this to my attention.
I have not...

Hi Kevin, thanks for using it and for bringing this to my attention.

I have not had a chance to test the plugin against Confluence 5.x, but I will check compatibility and update the latest release to be compatible with 5.x if there are no problems. Otherwise I will release a new version that introduces compatibility with 5.x.

Also thank you for opening a JIRA issue for this. I will use that ticket (JENKINS-17693) to track progress.

Hi Joe, I'm fairly new to confluence macros and trying to integrate this plugin ...

Hi Joe, I'm fairly new to confluence macros and trying to integrate this plugin on my Jenkins, so that ever time there is a new build then my post build activity should update my Confluence page with the latest version.

I taught jenkins-between token macro should help me do the job, but when I followed the above instructions I was able to setup Jenkins the way its documented but having difficulty creating the macro on Confluence page.

Can you please provide instruction on the below:

1. How to create the jenkins-between macro on Confluence page.

2. Information on how to send latest build number as part of the Text content.

1. How to create the jenkins-between macro on Confluence page.
If you mean creat...

1. How to create the jenkins-between macro on Confluence page.

If you mean creating the macro in the Confluence Admin, the instructions for that are outlined above.
If you are asking how to insert that macro into a Confluence page itself, the easiest way is to start typing it with braces: {jenkins-between. The Confluence editor will popup a list of suggestions, and you can pick the "Jenkins Between-Tokens Marker" macro from the suggestions list. Once it adds the macro marker itself, you can click on it and select the "Edit" button to specify the marker id.

2. Information on how to send latest build number as part of the Text content.

You can use "{$BUILD_NUMBER}" in the text field, and that should get expanded to the actual Jenkins build number. You can use any other environment variable available to the build (e.g., {$BUILD_URL} will give you a full, clickable URL that takes you to the currently executing build within Jenkins.

How is optimistic locking handled when two Jenkins jobs leveraging the Confluenc...

How is optimistic locking handled when two Jenkins jobs leveraging the Confluence Publisher Plugin - attempt to update the same wiki page? From what I've researched there's no mention of this with this plugin - so my assumption is that this scenario would allow the Jenkins job that wins the race condition to update the page - where as the loser would report a job failure within Jenkins. If this isn't handled with the plugin - is there a way to get Jenkins to retry a task for specific exceptions (or with all failures)?

I am learning Confluence currently and would like to have Jenkins to post the bu...

I am learning Confluence currently and would like to have Jenkins to post the build result to Confluence page. I followed your instruction and am able to post some result like $BUILD_ID, $BUILD_RESULT. I would also like to post the output of the console. Is it possible, and if so, how do I do that ?