Missed Team ’24? Catch up on announcements here.

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

Rest Java Client Library maven dependency

Mikhail_Kopylov
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.
August 8, 2013

Hi there.

Using InteeliJ Idea, I can't add JRJC library to my maven project.

Added repository to my pom.xml as said here: https://ecosystem.atlassian.net/wiki/display/JRJC/Download

Added dependency com.atlassian.jira:jira-rest-java-client as said here: https://ecosystem.atlassian.net/wiki/display/JRJC/Tutorial

But Idea can't found this dependency of any version.

Where is this dependency?

BTW, I'm using JIRA 6.1 version.

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Answer accepted
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2013

Hi Omickron,

It seems that artifact naming have been changed and now these could be used as a dependencies:

* jira-rest-java-client-api

* jira-rest-java-client-core

* jira-rest-java-client-plugin

The latest available version available for these components is 2.0.0-m25

As for jira-rest-java-client artifact, the latest available version is 2.0.0-m2.

--

Cheers, Ignat.

Mikhail_Kopylov
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.
August 11, 2013

Thank's, Ignat! The compilation succeeds!

But when I run the project I've got an ClassNotFoundException in the row

JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();

SEVERE: Servlet.service() for servlet [servlet-module-container-servlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory
  at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
  at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
  at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

May be I have to import some additional components in atlassian-plugin.xml?

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2013

Omickron,

I could not find the root of the problem from the stacktrace you have provided. Could you share a sample code repository where the bug is reproduced? E.g. pom.xml and the client class.

Alternatively, I have mentioned the bitbucket repository of the jira-rest-java-client project. You could clone the repository and browse the 'plugin' and 'test' modules and see the configuration of these. Also you could browse the java classes.

--

Cheers, Ignat.

Mikhail_Kopylov
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.
August 11, 2013

Here it is, Ignat.

I haven't any ideas about what's wrong in my plugin.

CreateIssuesServlet - it's the class with 38-44 lines for creating an issue.

Thank you for help!

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2013

Omickron,

Why do you use scope=provided?

Could you run this configuration?

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-api</artifactId>
    <version>2.0.0-m25</version>
</dependency>
<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-core</artifactId>
    <version>2.0.0-m25</version>
</dependency>

I just removed the "scope" section so Maven would use default compile scope.

--

Cheers, Ignat.

Mikhail_Kopylov
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.
August 11, 2013

I've removed "provided" scope and got a huge stacktrace when starting JIRA

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2013

Hi Omickron,

Do you have the jira-rest-java-client-core included in your web application?

The AsynchronousJiraRestClientFactory is located in this jar.

If you need to refer to the JIRA REST client sources, it has public reposiotry on bitbuket:

https://bitbucket.org/atlassian/jira-rest-java-client

--

Cheers, Ignat.

Mikhail_Kopylov
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.
August 11, 2013

Yes, Ignat, jira-rest-java-client-core is included in pom.xml

<dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-api</artifactId>
            <version>2.0.0-m25</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client-core</artifactId>
            <version>2.0.0-m25</version>
            <scope>provided</scope>
        </dependency>

And my IntelliJ Idea finds this class.

But when I start atlas-debug and try to enter the servlet which uses AsynchronousJiraRestClientFactory, I get this error.

I have already run mvn clean and restarted JIRA from blank. But the error still appears.

Should I have any "component-import" sections in my atlassian-plugin.xml to use Jira REST Client?

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2013

Omickron, looks like the logs have not been attached.

--

Cheers, Ignat.

Mikhail_Kopylov
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.
August 8, 2013

Hmm.. Sorry, here it is

Mikhail_Kopylov
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.
August 8, 2013

Ignat, looks like I used wrong version of jira-rest-java-client artifact.

This dependency works fine:

<dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-java-client</artifactId>
            <version>2.0.0-m2</version>
        </dependency>

Could you tell me, what is the latest version of this artifact?

0 votes
Ignat
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2013

Dear Omickron,

Did you added atlassian repository to .m2/settings.xml ?

Could you provide logs of execution mvn package in your plugin folder?

--

Cheers, Ignat.

Mikhail_Kopylov
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.
August 8, 2013

(log.txt)

Yes, Ignat, I've added atlassian repository, but not in settings.xml - in pom.xml.

Here's log from mvn package, called from Idea

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events