Compiling BlogPostMacro by myself

Hello,

I tried to compile the BlogPostMacro by myself to lift the limit of 15 posts. I took the source code from the bitbucket repository and tried to get it running. Unfortunately, when I try to get it to display the blogposts, it yields a Null error because the SearchManager can’t be initalized.
I added the “com.atlassian.confluence.search.v2;resolution:=optional” to import package in the pom.xml at maven configuration where spring gets imported. Afterwards I tried several different ways to get the instance of the SearchManager. I tried to declare the component needed in the old fashioned v1 way in the atlassian-plugin.xml, to initialize via the BlogPostMacro constructor (which fauls because the amount of arguments does not match) and also to get it via the ContainerManager which probably doesn’t work because it is not available in the ContainerManager.

Are there any other steps I could take to get a modified BlogpostMacro running?

Got the URL to repository handy?

Sure, here you go: Bitbucket

What version of the SDK are you using?

type ‘atlas-version’ at the command prompt.

Hi alain,

I’m using v6.2.14

Looking more closely I notice that the pom is targeting an ‘on demand’ version of the host application (5.9.1-OD-2015.47.1-0002 - the OD means on demand) … which I suspect is part of the problem since you won’t have the environment to be able to run an onDemand version of the application.

The most recent non OD version I can see is the ‘confluence-advanced-macros-3.5.x-stable’ branch

https://bitbucket.org/atlassian/confluence-advanced-macros-plugin/src/9721565c1c38f8e0a60d98d5b2095a42b674a7bf/pom.xml?at=confluence-advanced-macros-3.5.x-stable&fileviewer=file-view-default

I don’t currently have a confluence instance running, so I’m unsure what version is packaged with the most recent releases.