How to use Apache POI in JIRA?

How to use Apache POI in JIRA?

6 answers

1 accepted

0 votes
Accepted answer

Problem is now solved!

Hi Matti,

How can you solve this problem? Could you please explain?

Add this to pom.xml.

<dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.9</version>
            <scope>compile</scope>
        </dependency>
       
        <dependency>
           <groupId>org.apache.poi</groupId>
           <artifactId>poi-ooxml</artifactId>
           <version>3.9</version>
           <scope>compile</scope>
        </dependency>
        
        <dependency>
           <groupId>org.apache.poi</groupId>
           <artifactId>poi-ooxml-schemas</artifactId>
           <version>3.9</version>
           <scope>compile</scope>
        </dependency>
        
        <dependency>
           <groupId>org.apache.xmlbeans</groupId>
           <artifactId>xmlbeans</artifactId>
           <version>2.6.0</version>
           <scope>compile</scope>
        </dependency>

However, only Apache POI 3.9 works.

Nope. It didn't work sad

Unresolved constraint in bundle com.tezExtensions [165]: Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=com.sun.javadoc)

I am sorry I forget these lines from pom.xml

<dependency>
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
          <version>2.0.2</version>
          <scope>compile</scope>
        </dependency>
        
        <dependency>
           <groupId>xerces</groupId>
           <artifactId>xercesImpl</artifactId>
           <version>2.11.0</version>
           <scope>compile</scope>
        </dependency>
        
        <dependency>
           <groupId>stax</groupId>
           <artifactId>stax-api</artifactId>
           <version>1.0.1</version>
           <scope>compile</scope>
        </dependency>

I have fixed my problem in another way and now I can use any version of POI. You can find the solution in stackoverflow.com/questions/39013590/apache-poi-usage-with-apache-felix

3 votes

When writing questions, it really helps if you

Give us context - broadly, what is the end goal? What will the user be able to do that they can't do now?

When using acronyms or software names, please do not assume that everyone knows every library, piece of software and random acronym out there. You can assume that people here know Atlassian software, as that's what we're here for. We're mostly techies, so mentioning the big important names is fine - Linux, Microsoft, Mac, Java, PostGreSQL, CSS, Javascript, etc. But anything else - explain, and give us the relevant links. If you don't, then a lot of people will simply read it, shrug, go "no idea, I've got no contribution here" and ignore you.

Do you want to access documents from your plugin ?

I do not find Apache POI Framework .jar-package from any lib-folder on JIRA installation. So Do I need a manaually add POI .jar-package to JIRA's lib-folder?

You did not find POI jar in Jira because Jira does not use it .

You can add the JAR in WEB-INF/lib but how will you use it ?

If you are creating a plugin you can add dependency of the POI jar in your plugins POM

All Excel reporting you see in JIRA is not really Excel but HTML, JIRA does not use POI, if you want to add this in your plugin you should add it as a dependency on the pom file and the default is complile which will include POI lib's in your plugin jar file.

=== personal experience

I wrote a plugin with POI and my client was experimenting with Structure plugin as well, for some reason it was killing of JIRA because i was using 3.8 and Structure plugin was using 3.7 and had to revert back mine which had control over.

could not pin point as to why it messd up apart from hiding behind the usual bloody class loaders allways messes up my stuff :(

Thanks Igor, as said in my comment syncing up the versions seems to have resolved it and if it helps this is on JIRA version 4.4 unless some one comes accross the same issue you can ignore it.

@parthis Let me know if you still have collisions with Structure. The library should be isolated, we don't export POI classes in Structure. You can send me more information and probably your plugin JAR to support@almworks.com, we'll try to figure out what happens.

Okay, I am developing Timesheet for JIRA plugin and one of the my customers wants reports from work logs as MS Excel file. I have a few questions about this.

1. What is artifactId of POI?

2. Is it possible to place poi jar to plugins META-INF/lib folder?

If you are using Jira 5 just add this to the plugin POM:

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8</version>
<scope>compile</scope>
</dependency>

The "compile" scope is the key.

The jar will be placed where needed (META-INF/lib).

@Igor Sereda [ALM Works], it looks like Structure is exporting the full POI 3.9 library... Please watch the JIRA OSGI console > Structure > Export Package.

I installed Structure on my dev environment to explore the exported packages after read this question as some of my plugins are POI consumers...

 

@Kinto Soft Thanks for the pointers! That is strange indeed... We'll check that and see how to get rid of this. Some of the Structure API deals with Excel export, but POI should not be exported.

In any case, simply exporting POI must not be a problem. You should be able to limit which POI versions you import in other bundles, or mark POI packages as private if you ship your own library.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 5 hours ago in Agile

Try the new Jira Cloud add-on for Google Sheets

Hi Atlassian community, I work on the product integration team at Atlassian and I am very excited to announce the early access program for the Jira Cloud add-on for Google Sheets. This add-on giv...

94 views 1 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you