How can I find the version of XWiki I'm running?
Last modified by Thomas Mortagne on 2017/12/12
First it depends what you mean by "XWiki version".
Version of some feature/API of XWiki
If what you want to know is which API/feature to use depending on the version then the safest is to check the version of the core or installed extension which contain this API/feature.
For example to know the version of Extension Manager scripting API you can do the following:
- Go to the Administration -> Extensions section -> switch to Installed or Core extensions and search for Extension - Script
- Create a new page or edit any existing page in wiki model, put the following and click the 'preview' button:{{velocity}}
$services.extension.core.getCoreExtension('org.xwiki.platform:xwiki-platform-extension-script').id.version.value
{{/velocity}} - From Java:@Inject
private CoreExtensionRepository coreExtensionRepository;
...
CoreExtension extension = this.coreExtensionRepository.getCoreExtension("org.xwiki.platform:xwiki-platform-extension-script")
Version version = extension.getId().getVersion() - Access your server's filesystem and inside XWiki's WEB-INF/lib directory look for JARs using the format xwiki-platform-extension-script-<version>.jar. The <version> part will be your version.
Version of current product/distribution
The XWiki Dev Team maintain a XWiki distribution which is the default one and is in sync with the XWiki jars it contains. But anyone can create a distribution of XWiki (usually a custom WAR or something containing a WAR) by picking up some specific core extension. For example some service hosting special version of XWiki.
- Check the bottom of any page and if you haven't overwritten the default skin/templates you should see something like:
- Create a new page or edit any existing page in wiki model, put the following and click the 'preview' button, it will display your XWiki version:{{velocity}}
$services.extension.core.repository.environmentExtension.id.version.value
{{/velocity}} - From Java:@Inject
private CoreExtensionRepository coreExtensionRepository;
...
CoreExtension distributionExtension = this.coreExtensionRepository.getEnvironmentExtension()
Version version = distributionExtension.getId().getVersion() - Access your server's filesystem and open XWiki's META-INF/extension.xed. Looks at the value of the <version> XML element (usually on the 4th line).