...
All PCJ extensions must declare which version of PCJ they are compatible with. This is done by adding a parameter to the app's atlassian-plugin.xml file, as shown below:
atlassian-plugin.xml
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}"/> <param name="plugin-icon">images/pluginIcon.png</param> <param name="plugin-logo">images/pluginLogo.png</param> <param name="min-pc-version-supported">3.8.0</param> </plugin-info> <!-- add our i18n resource--> <resource type="i18n" name="i18n"location="sample-extension-one"/> <!-- add our web resources--> <web-resource key="sample-extension-one-resources" name="sample-extension-one Web Resources"> <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="images/"location="/images"/> <context>sample-extension-one</context> </web-resource> </atlassian-plugin> |
...
Your app will need access to the extension-spi jar to use all the interfaces and classes described in this document. Add this dependency to your pom.xml file:
pom.xml
Code Block | ||
---|---|---|
| ||
... <dependency> <groupId>com.awnaba.projectconfigurator</groupId> <artifactId>extension-spi</artifactId> <version>${projectconfigurator.version}</version> <scope>provided</scope> </dependency> ... |
Some extensions will have to use also the class ObjectAlias
, which is defined in a different jar (operations-api). In rare cases, extensions might require other classes from this same jar. In any of these cases, add the following dependency:
pom.xml
Code Block | ||
---|---|---|
| ||
... <dependency> <groupId>com.awnaba.projectconfigurator</groupId> <artifactId>operations-api</artifactId> <version>${projectconfigurator.version}</version> <scope>provided</scope> </dependency> ... |
...
This would be specified in the pom.xml file as:
pom.xml
Code Block | ||
---|---|---|
| ||
<build> <plugins> <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>jira-maven-plugin</artifactId> <version>${amps.version}</version> <extensions>true</extensions> <configuration> ..... <!-- See here for an explanation of default instructions: --> <!--https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins --> <instructions> ..... <!-- Add package import here --> <Import-Package> org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", <!--Note the packages from PC must be in DynamicImport-Package, so the following exclusion is added here --> !com.awnaba.projectconfigurator.*, * </Import-Package> <!--Packages from Project Configurator must be imported dynamically to allow the extension to interact with them, even if PCJ is installed later --> <DynamicImport-Package> com.awnaba.projectconfigurator.* </DynamicImport-Package> ..... |
...
Creating an extension consists of implementing some of the interfaces that are defined in the extension-spi-XXXX.jar. You do not have to call the methods offered by those interfaces. PCJ will call them at the right times during the export or import operations.
Tip |
---|
Remember! "Don't call us; we'll call you." |
...