Saturday, March 31, 2012

Confluence 3.x and com.atlassian.confluence.content.render.xhtml

com.atlassian.confluence.content.render.xhtml is a package from Confluence 4, responsible for rendering new XHTML macro. If you compile your plugin for Confluence 4 and your plugin has <xhtml-macro/>, then you will get an import of com.atlassian.confluence.content.render.xhtml in your MANIFEST.MF. Something like this:

com.atlassian.confluence.content.render.xhtml;version="0.0"

So far, so good. But what happens, if you try to install your plugin in confluence 3.x?


org.osgi.framework.BundleException: Unresolved constraint in bundle com.skype.confluence.skype-bth [72]: Unable to resolve 72.0: missing requirement [72.0] package; (&(package=com.atlassian.confluence.content.render.xhtml)(version>=0.0.0))


The reason is obvious, com.atlassian.confluence.content.render.xhtml is missing in confluence 3.x, but we are asking for it. Even though, we are not going to use it. We might have separate <macro/> definition, that does not need XHTML.

Solution is to tell Felix, that com.atlassian.confluence.content.render.xhtml is optional:

<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-confluence-plugin</artifactId>
<version>3.8</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
com.atlassian.confluence.content.render.xhtml;resolution:=optional;version="0.0.0",
*;version="0.0"
</Import-Package>
</instructions>
</configuration>
</plugin>
view raw pom.xml hosted with ❤ by GitHub


1 comment:

  1. Java today is one of the most popular digital applications in web designing & is being preferred by the layman as
    well as high end users for different purposes such as in flash video application, 3-D gaming, complex software development etc....
    java

    ReplyDelete