- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| .idea/codeStyles | ||
| .mvn | ||
| bundles/org.apache.poi | ||
| LICENSES | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .yamlfix.toml | ||
| CHANGELOG.md | ||
| CODING_STANDARDS.md | ||
| CONTRIBUTING.md | ||
| pom.xml | ||
| README.md | ||
| RELEASE.md | ||
| renovate.json | ||
Custom third-party dependencies
Use case and potential problems
Sometimes, third-party libraries, required to run custom extensions, are missing in Polarion platform or exist in old versions. In this cases developer can either:
- package third-party dependencies in own extension bundle;
- provide third-party dependencies in separate bundle
First approach can have the following problem: because own extension bundle uses Require-Bundle statement to import Polarion dependencies, it causes import all transitive dependencies of required bundles with high priority.
As a result, imported Polarion transitive dependencies will be used instead packaged into own extension bundle. This can cause versions mismatch and runtime errors. In such case second approach is preferred.
Solution
We have faced the such problem when tried to use Apache POI v5.2.4. This version uses Apache Commons IO v2.13.0, but Polarion has v2.11.0. As a result it leads to ClassNotFoundExceptions in some cases when Apache POI functionality is called. This project demonstrates how to solve this problem using the packaging of Apache POI dependency as a separate bundle.
Quick start
The latest version of the extension jars can be downloaded from the releases page and installed to Polarion instance without necessity to be compiled from the sources.
The extension jars should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.thirdparty.bundles.<BUNDLE_FOLDER>/eclipse/plugins folder(s).
For example jar file org.apache.poi-1.3.0.jar should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.thirdparty.bundles.org.apache.poi/eclipse/plugins folder.
Changes will take effect after Polarion restart.
Important
Don't forget to clear
<polarion_home>/data/workspace/.configfolder after extension installation/update to make it work properly.
Build
All the extension artifacts can be produced using maven:
mvn clean package
Installation to Polarion
To install the extensions to Polarion they should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.thirdparty.bundles.<extension_name>/eclipse/plugins
It can be done manually or automated using maven build:
mvn clean install -P install-to-local-polarion
For automated installation with maven env variable POLARION_HOME should be defined and point to folder where Polarion is installed.
Changes only take effect after restart of Polarion.
How to use
To use Apache POI as an extension bundle the following changes are required:
pom.xmlshould have a provided dependency
<dependency>
<groupId>ch.sbb.polarion.thirdparty.bundles</groupId>
<artifactId>org.apache.poi</artifactId>
<version>1.3.0</version>
<scope>provided</scope>
</dependency>
MANIFEST.MFshould containRequire-Bundleentrych.sbb.polarion.thirdparty.bundles.org.apache.poi