How to use jira-api dependency?

D. U. January 23, 2018

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

3 votes
D. U. January 23, 2018

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