Hi. Just tried to publish some packages from my plugin to others.
Problem is : in my plugin I use Active Objects import. It configured in atlassian-plugin.xml.
<component-import key="ao-import" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects"> <description>Component to access Active Objects functionality from the plugin</description> </component-import>
It works fine and so on. BUT. When I trying publish packages in pom.xml like that :
<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> <instructions> <Export-Package> my.little.pony.plugin.event*;version="${project.version}" </Export-Package> </instructions> </configuration> </plugin>
I receive this message in console on runtime :
"Unable to enabel plugin ... *blah blah* ... Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle my.little.pony.plugin [92]: Unable to resolve 92.0: missing requirement [92.0] package; (&(package=com.atlassian.activeobjects.external)(version>=1.0.0))
So ok, it's imported with wrong version now, exactly, checking generated MANIFEST.MF in .osgi-plugins i found
Import-Package: ... blah blah ... com.atlassian.activeobjects.external;resolution:="mandatory";version="1.0"
instead of
Import-Package: ... blah blah ... com.atlassian.activeobjects.external
in first (working fine) case.
So why it changed activeobjects version when i did some unrelated stuff and how to fix this issue?
Community moderators have prevented the ability to post new answers.
Put the Import-Package into your instructions explicitly:
<instructions>
<Import-Package>com.atlassian.activeobjects.external,*;resolution:=optional</Import-Package>
<Export-Package>my.little.pony.plugin.event*;version="${project.version}"</Export-Package>
</instructions>
This just don't work as I want - in this case <Import-Package> instructions override all explicit and emplicit imports, imports in atlassian-plugin.xml too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@IgorLoskutoff Updated answer to add the optional wildcard entry, restoring implicit imports.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Charles, thanks for your answers. But it didn't work too.
I just keep receive
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle ru.myplugin.blahblah [92]: Unable to resolve 92.0: missing requirement [92.0] package; (&(package=com.atlassian.activeobjects.external)(version>=1.0.0))
Of course I resolved it by making necessary classes public components in atlassian-plugin.xml but this decision doesn't satisfy me, its ugly and not error-prone. Hovewer works.
I wonder how to resolve problem and use atlassian-plugin.xml imports and pom.xml imports together, any suggestions are welcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No 1.0 version exists yet -- depending on which Atlassian project you're using, you might need to specify a minimum version more like 0.19.7 (which JIRA 5.0.x uses).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.