How to use jira-api dependency?

I am using JIRA 7.1.6 and I want to use the IssueEvent class in my Java application. It seems as if I have to use the jira-api dependency in my POM but when I run a build it always fails with an exception:

[ERROR] Failed to execute goal on project myproject: Could not resolve dependencies for project xx.abcde:myproject:jar:0.0.1-SNAPSHOT: Could not find artifact jta:jta:jar:1.0.1 in Central Repository (http://central.maven.org/maven2/) -> [Help 1]

Here is my repository section of the POM:

 <repositories>
<!-- <repository>
<id>Attlassian-Maven-Legacy</id>
<url>https://packages.atlassian.com/maven-closedsource-legacy/</url>
</repository> -->
<repository>
<id>Central Repository</id>
<url>http://central.maven.org/maven2/</url>
</repository>
<repository>
<id>Attlassian-Maven-External</id>
<url>https://packages.atlassian.com/maven-hosted-atlas-external/</url>
</repository>
<repository>
<id>Attlassian-Maven</id>
<url>https://packages.atlassian.com/maven/</url>
</repository>
<repository>
<id>Attlassian</id>
<url>https://maven.atlassian.com/content/repositories/atlassian-public/</url>
</repository>
<repository>
<id>Attlassian-3d-Party</id>
<url>https://maven.atlassian.com/3rdparty/</url>
</repository>
</repositories>

 

Even when I try to include the JTA dependency manually: 

 <dependency> 
<groupId>jta</groupId>
<artifactId>jta</artifactId>
<version>1.0.1</version>
</dependency>

...it doesn't help.

Using https://maven.atlassian.com/webapp/#/artifacts/browse/tree/General/maven-closedsource-legacy/com/atlassian/jira/jira-api/7.1.6/jira-api-7.1.6.jar shows us, that the dependency exists and I can find IssueEvent in the JAR.

So my question is: How can I achieve it using jira-api to finally use the IssueEvent class?

1 answer

I found out that I have to exclude the JTA dependency used internally in jira-api:

 <dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>jta</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

768 views 2 19
Join discussion

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