Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add dependency to jira7 plugin?

Zafer Cakmak December 16, 2015

Hi,

I'm developin a "new" JIRA plugin for jira7. Plugin initialization is ok but if I want to add a third party dependency plugin(OSGi) gives error. How can I add a dependency to a newly created jira7 plugin?

 

Steps that I did:

  • Create a new JIRA plugin with command "atlas-create-jira-plugin" (after that atlas-run runs without any problem)
  • Add a new dependency inside to dependencies block of pom.xml (jasperreports in my case)

    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>6.2.0</version>
    </dependency>
  • Run "atlas-run"
  • You've the "missing requirement" error

    [INFO] [talledLocalContainer]     	'com.jira.plugins.app' - 'app'  failed to load.
    
    [INFO] [talledLocalContainer]     		Cannot start plugin: com.jira.plugins.app
    
    [INFO] [talledLocalContainer]     			Unresolved constraint in bundle com.jira.plugins.app [162]: Unable to resolve 162.0: missing requirement [162.0] osgi.wiring.package; (osgi.wiring.package=antlr)

 

I've tried to add 'net.sf.jasperreports.*;version="6.2.0",' to the Import-Package section like defined in this page: https://developer.atlassian.com/docs/getting-started/working-with-the-pom/managing-dependencies

How can I solve such a dependency issue?

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Titus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 16, 2015

It seems that a dependency to antlr is missing. So the error message tells you that osgi is missing a wiring package:

(osgi.wiring.package=antlr)

So you should add the dependency of antlr to your pom.xml

 

<dependency>

            <groupId>org.antlr</groupId>

            <artifactId>antlr4-runtime</artifactId>

            <version>3.5.2</version>

        </dependency>

But I'm not sure about the version number but at the startup using the debug environment all available packages are listed.

atlas-run -X

 

After you added the dependency you probably need to clean or rebuild your maven environment:

https://maven.apache.org/plugins/maven-eclipse-plugin/usage.html

 

Zafer Cakmak December 16, 2015

but antlr isn't my dependency. It's a compile dependency of jasperreports (you can check out other dependencies of jasperreports from here: http://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.2.0) I think I shouldn't add any dependencies of my dependency to pom.xml. On the other hand adding antlr to my dependency doesn't solve anything because in this case another compile dependency(bsh) of jasperreports gives a missing requirement error. It doesn't make sense to add all dependencies of my dependencies to pom.xml.

Zafer Cakmak December 18, 2015

@Titus what do you think on my comments?

Titus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 18, 2015

If jasperreports depends on antlr and other things all of those must be added as a dependency in your pom.xml. I can just guess from the error message which says that osgi is missing a package. And it says that the package is antlr. When you add antlr as a dependency which new one shows up and causes an error? can you post that error message as well?

TAGS
AUG Leaders

Atlassian Community Events