Confluence 8.8 is available now

Confluence “polyfills”:

For everyone struggling with ensuring that their app is compatible with 7.19-8.8, I believe I’ve succeeded to do it (pending feedback from customers, but it seems to work well) by having 1 library compiling against each version of Confluence, then shipping all those jars into the same plugin jar, then choosing dynamically at runtime which implementation it uses. So:

  • my-polyfill-confluence-7.19.jar implements an interface
  • my-polyfill-confluence-7.20.jar implements the same interface, etc., each compiling against their version of Confluence, so I have autocompletion and compile-time check that I’m not using an invalid class,
  • In the final utils-confluence.jar, a FactoryBean which chooses the final implementation, which uses AutowireCapableBeanFactory to autowire the final jar,
  • I end up with using my interface, such as “CQLSearchAdaptor” or “PermissionAdaptor”, in my plugin, which then works seamlessly.

The (redacted) pom.xml and Java classes are demonstrated there: https://github.com/requirement-yogi/demo-confluence-polyfills/blob/master/libs/utils-confluence/src/main/java/com/requirementyogi/server/utils/confluence/compat/PermissionAdaptorFactoryBean.java

Haven’t tried it with Confluence 9.0, but I’ve found it was an (excellent) architectural idea when someone told me about it (I don’t remember who, sorry for not being to attribute it).

3 Likes