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:
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |