Mono
Mono

Reputation: 241

Jira plugin development dependencies

I´m creating custom jira plugin and everything works fine, until I add one dependency into plugins pom.xml. After adding the dependency (with scope compile) I´m getting

org.osgi.framework.BundleException: Unresolved constraint in bundle <my.bundle>

I'm getting this exception even if the dependency isn't used in the plugin code. The plugin is build with that dependency in target/classes/. I don't understand, where could be the problem.

I have found more details about the exception

[c.a.p.osgi.factory.OsgiPlugin] Detected an error (BundleException)
enabling the plugin 'cz.bios.jrt' : Unresolved constraint in bundle cz.bios.jrt [213]: 
Unable to resolve 213.0: missing requirement 
[213.0] osgi.wiring.package; (osgi.wiring.package=org.apache.avalon.framework.logger)

That it seems I'm missing org.apache.avalon.framework.logger package, am I right?

Upvotes: 2

Views: 613

Answers (1)

Mono
Mono

Reputation: 241

The solution is to export those missing packages in plugins pom.xml like this:

        <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-jira-plugin</artifactId>
            <version>${amps.version}</version>
            <extensions>true</extensions>
            <configuration>
                <productVersion>${jira.version}</productVersion>
                <productDataVersion>${jira.version}</productDataVersion>

                <enableQuickReload>true</enableQuickReload>
                <enableFastdev>false</enableFastdev>
                <instructions>
                    <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                    <Export-Package>cz.bios.jrt,cz.bios.jira,org.apache.avalon.framework.logger,org.apache.log,com.atlassian.inject,com.sun.xml.fastinfoset.sax</Export-Package>
                    <Import-Package>org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
                    <Spring-Context>*</Spring-Context>
                </instructions>
            </configuration>
        </plugin>

Upvotes: 4

Related Questions