Dependencies

Last modified by Thomas Mortagne on 2020/03/23 10:15

Extensions can define dependencies. Those will automatically be installed by Extension Manager when installing the extension. It's also a good way to make sure the extension is installed on the right version of XWiki.

See also Maven repository handler documentation to have more details on how exactly to define dependencies in the Maven build.

Optional dependencies

It's possible to indicate that a dependency is optional. This means that Extension Manager will install all of them by default but optional dependencies won't have any impact on the validity of the extension:

  • if the optional dependency install plan fail the extension is installed without it
  • if the optional dependency is uninstalled it won't uninstall the extension
  • if the optional dependency is missing at startup it won't make the extension invalid

Since 11.7RC1, in the context of Maven repositories, this apply only to extensions using the custom Maven property xwiki.extension.optionalIncluded with true to avoid going against Maven default behavior (for retro compatibility reasons it's true by default for grouIds prefixes known to be XWiki often be extensions: "org.xwiki" and "com.xwiki"). See custom Maven properties for more details.

Managed dependencies

Since 8.1, Extension Manager support the concept of managed dependencies.

Its the same idea than Maven's <dependencyManagement> element. It allows the following:

  • indicate the version or other properties associated to a dependency in managed dependencies and just indicate the id in the actual dependencies
  • overwrite the version or other properties associated to any corresponding transitive dependency

Ignored dependencies

Since 12.2 and 11.10.4 you can force Extension Manager to ignore a set of dependencies using the property  in xwiki.properties file:

  extension.ignoredDependencies=stax:stax
  extension.ignoredDependencies=javax.xml.stream:stax-api
  extension.ignoredDependencies=stax:stax-api
  extension.ignoredDependencies=xalan:xalan
  extension.ignoredDependencies=xalan:serializer

Get Connected