Hello.
I'm just making my first steps with JIRA, so please excuse my questions.
I want to access JIRA using Java and Eclipse.
Here: Remote API Reference it says, the recommended API is REST.
Here: JIRA REST APIs it says, I need the Atlassian REST plugin, but there isn't a download link. Is this the right file: https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/jira/jira-rest-java-client/2.0.0-m2/jira-rest-java-client-2.0.0-m2.jar? (I prefer jar files rather than maven dependencies.)
I also found REST Java Client for JIRA, but I'm not sure if it's necessary. It also says, it available for JIRA 5.0 - 6.0, but the latest version ist 6.2.3.
Do I need any more plugins, for example JAX-RS or Jersey?
The number of possibilities confuses me. I just need a list of the plugins and jar files to be able to interact with JIRA.
Thank you!
Community moderators have prevented the ability to post new answers.
In order to retain sanity, when with JIRA, you really do need to get your head into Maven, as this solves the 'what jars do I need' question. Then you can start a simple Maven project and add in the required dependencies, such as JRJC, and everything else pretty much hangs off that. Get an example maven project working, and build on that.
JRJC will save you some wondering about JSON, the source is available to know more.
Use this in your Maven client project:
<dependency>
<groupId>com.atlassian.jira<
/
groupId>
<artifactId>jira
-
rest
-
java
-
client
-
core<
/
artifactId>
<version>
2.0
.
0
-
m30<
/
version>
<scope>provided<
/
scope>
<
/
dependency>
Repo url: https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/jira/jira-rest-java-client/2.0.0-m2/
JRJC examples:
- https://ecosystem.atlassian.net/wiki/display/JRJC/Migrating+from+JRJC+1.x+to+2.x
OK, I set up Maven and added this dependency. Then I clicked "Maven->Update project". But I get the following error:
Missing artifact com.atlassian.jira:jira-rest-java-client-core:jar:2.0.0-m30
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone following this from the start, I shoudl have linked the SDK page as well, this bundles a version of Maven configured with the Atlassian repositories, which will be required to resolve artifacts in the com.atlassian domain. You use it from the command line with 'atlas-mvn', eclipse can be configured to use the SDK maven repository. This isn't as great an experience as it could be as the SDK will update itself from time to time, and ide links break due to folder changes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JIRA developers, please consider
<dependency> <groupId>com.squareup.retrofit2</groupId> <artifactId>retrofit</artifactId> <version>2.1.0</version> </dependency>
Here is an example of the pain you are causing ...
DETAILS
I just added these two dependencies to my pom:
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
</dependency>
the build then pulled in 23! jars to my runtime! classpath
com/atlassian/event/atlassian-event/2.3.5/atlassian-event-2.3.5.jar (48 KB)
com/atlassian/httpclient/atlassian-httpclient-api/0.23.0/atlassian-httpclient-api-0.23.0.jar (50 KB)
com/atlassian/httpclient/atlassian-httpclient-plugin/0.23.0/atlassian-httpclient-plugin-0.23.0.jar (2123 KB)
com/atlassian/jira/jira-rest-java-client-api/4.0.0/jira-rest-java-client-api-4.0.0.jar (149 KB)
com/atlassian/jira/jira-rest-java-client-core/4.0.0/jira-rest-java-client-core-4.0.0.jar (187 KB)
com/atlassian/sal/sal-api/3.0.3/sal-api-3.0.3.jar (72 KB)
com/atlassian/util/concurrent/atlassian-util-concurrent/2.4.2/atlassian-util-concurrent-2.4.2.jar (133 KB)
com/sun/jersey/jersey-client/1.5/jersey-client-1.5.jar (126 KB)
com/sun/jersey/jersey-core/1.5/jersey-core-1.5.jar (445 KB)
com/sun/jersey/jersey-json/1.5/jersey-json-1.5.jar (142 KB)
com/sun/xml/bind/jaxb-impl/2.2.3/jaxb-impl-2.2.3.jar (870 KB)
javax/xml/bind/jaxb-api/2.2.2/jaxb-api-2.2.2.jar (103 KB)
org/apache/httpcomponents/httpasyncclient-cache/4.1/httpasyncclient-cache-4.1.jar (35 KB)
org/apache/httpcomponents/httpasyncclient/4.1.2/httpasyncclient-4.1.2.jar (173 KB)
org/apache/httpcomponents/httpclient-cache/4.4.1/httpclient-cache-4.4.1.jar (156 KB)
org/apache/httpcomponents/httpcore-nio/4.4.5/httpcore-nio-4.4.5.jar (348 KB)
org/apache/httpcomponents/httpmime/4.5.2/httpmime-4.5.2.jar (41 KB)
org/codehaus/jackson/jackson-core-asl/1.5.5/jackson-core-asl-1.5.5.jar (168 KB)
org/codehaus/jackson/jackson-jaxrs/1.5.5/jackson-jaxrs-1.5.5.jar (17 KB)
org/codehaus/jackson/jackson-mapper-asl/1.5.5/jackson-mapper-asl-1.5.5.jar (475 KB)
org/codehaus/jackson/jackson-xc/1.5.5/jackson-xc-1.5.5.jar (25 KB)
org/codehaus/jettison/jettison/1.1/jettison-1.1.jar (67 KB)
stax/stax-api/1.0.1/stax-api-1.0.1.jar (26 KB)
That produced ClassNotFoundException: com.atlassian.fugue due to a missing jar
So I googled, guessed, and added
<dependency>
<groupId>com.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>2.2.1</version>
</dependency>
Then got Null Pointer exception AsynchronousHttpClientFactory$MavenUtils - Could not find version for maven artifact com.atlassian.jira:jira-rest-java-com.atlassian.jira.rest.client while calling com.atlassian.jira.rest.client.internal.async.AsynchronousHttpClientFactory$MavenUtils.getVersion
googled, found out spring is overriding your older dependencies ... yep welcome to jar hell.
mvn dependency:tree
reveals ... both from jira.
+- com.atlassian.jira:jira-rest-java-client-core:jar:4.0.0:compile
| +- com.sun.jersey:jersey-client:jar:1.5:compile
| | \- com.sun.jersey:jersey-core:jar:1.5:compile
| +- com.sun.jersey:jersey-json:jar:1.5:compile
| | +- org.codehaus.jettison:jettison:jar:1.1:compile
| | | \- stax:stax-api:jar:1.0.1:compile
| | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3:compile
| | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
| | | \- javax.xml.stream:stax-api:jar:1.0-2:compile
] +- com.atlassian.httpclient:atlassian-httpclient-plugin:jar:0.23.0:compile
] | +- org.apache.httpcomponents:httpasyncclient-cache:jar:4.1:compile
] | +- org.apache.httpcomponents:httpclient-cache:jar:4.4.1:compile
] | | \- org.apache.httpcomponents:httpclient:jar:4.4.1:compile
Added this exclusion pulling in the 4.5.2 version
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
No love.
googled, saw this post
http://stackoverflow.com/questions/33135250/can-not-create-asynchronoushttpclientfactory
Added this exclusion
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<exclusions>
<exclusion>
<artifactId>logback-core</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
</exclusions>
</dependency>
RestClientException{statusCode=Optional.of(404), errorCollections=[ErrorCollection{status=404, errors={}, errorMessages=[]}]}
Stepping through your code I noticed the http client was sending
/rest/api/latest/rest/api/latest
removed it from my URI, and MONEY!
I reverted back to logback and logging still works, so that was a flase flag.
I still have the propery exception from MavenUtils.getVersion which is obviously not necessary.
anyway... you get the drift. Your java product needs some love.
This was way more trouble it could have been if you had simplified it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<sigh>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, now there's a number of different things here. Let's start by breaking out the systems and running over what they do and how they could interact (I'm going to over simplify here and probably tell you stuff you already know, but I need to cover it all just in case)
Eclipse is a development environment. There are two basic reasons for mentioning Eclipse alongside Jira
Note that you could be doing both!
Case 2 is the simple one. Jira is your issue tracker, it's useful to have issue information available in Eclipse, so you connect them using an Eclipse plugin. That's it really. Jira information appears in Eclipse, and you can update Jira information from Eclipse.
Case 1 is the more fuzzy one because when I say "for Jira", I could mean
Now, REST is an interface Jira exposes to the world so other computers can talk to it. You don't need any plugins to use it - it is a plugin, but it's distributed by default, so if you've installed Jira (4+), you've got it.
You can use the most basic simple REST calls to do stuff in Jira. I've not used REST a lot, but where I have, a lot of it is pretty simple stuff - I'm doing things like using curl in a script to hit one REST url. If I need something more clever, I tend to look at the JRJC for help and guidance, but you don't have to use it. Same for other libraries - if they're useful, use them, but you don't actually need anything to use REST off-the-shelf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.