Hi there, I'm trying to integrate a Jira-Connection into one of our internal tools. Unfortunately, this tool is not set up in maven, only in svn. What do I need to do to use JRJC for getting acces to our Jira? Can I simply include the .jar from https://marketplace.atlassian.com/plugins/com.atlassian.jira.jira-rest-java-client in the project library and build path from our tool? Thx in advance 4 your help.
Community moderators have prevented the ability to post new answers.
It should work in non-maven project. The easiest way would be to clone JRJC, checkout some released tag and run mvn:dependency:copy-dependencies
git clone git@bitbucket.org:atlassian/jira-rest-java-client.git cd jira-rest-java-client git checkout jira-rest-java-client-parent-2.0.0-m25 mvn dependency:copy-dependencies
After that the all dependencies should be in core/target/dependency/. Just use them in your project with JRJC jar.
Hi guys. I've been trying to compile a few of the JRJC examples with little luck. What I'd like to do is to download all the dependencies as jar files and compile (without maven!). Andy Brook has kindly provided a pom.xml above. Is there a way of using this to download all the jar files? I'm new to this so please be patient with me (:
Thanks for your help in advance. Nat
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.
Of course you can use it in your non-maven project (but why not use maven!). The only problem you have is satisfying that projects required dependencies as described in its pom.xml. If you manually download all these, and include in your 'app' classpath, it will work just fine. And when you move to the next version of JRJC, you'll of course remember to look for new dependencies and manually download/integrate them again right? (maven will help here!)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
another wat you can create rest client use java and jersy
package com.rest.client; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; public class RESTclient { public static void main(String[] args) { try { Client client = Client.create(); client.addFilter(new HTTPBasicAuthFilter("username", "password")); WebResource webResource = client.resource("http://localhosr:8080/rest/api/2/issue"); String input="{\"fields\":{\"project\":{\"key\":\"JIRA\"},\"summary\":\"Test Ticket\",\"description\":\"This is a test CR\", \"reporter\": {\"name\": \"prasad\"},\"issuetype\":{\"name\":\"Defect\"},\"versions\":[{\"name\":\"1.0\"}],\"customfield_10692\":{\"value\":\"Stability\"},\"customfield_10430\":{\"value\":\"Stability\"},\"customfield_10005\":{\"value\":\"Blocker\"},\"components\":[{\"name\":\"TEST\"}]}}"; ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input); String output = response.getEntity(String.class); System.out.println("Output from Server .... \n"); System.out.println(output); } catch (Exception e) { e.printStackTrace(); } } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answer. I know there are other ways apart from JRJC to use the rest api, but since atlassian provides the JRJC I would really like to use it. So, anyone knows the answer to my question? :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've downloaded Jersey JAX-RS 2.0 RI bundle and have all the jar files in my classpath but when trying to compile your code, I get errors like:
RESTclient.java:3: error: package com.sun.jersey.api.client does not exist
import com.sun.jersey.api.client.Client;
^
RESTclient.java:4: error: package com.sun.jersey.api.client does not exist
import com.sun.jersey.api.client.ClientResponse;
^
RESTclient.java:5: error: package com.sun.jersey.api.client does not exist
import com.sun.jersey.api.client.WebResource;
^
RESTclient.java:6: error: package com.sun.jersey.api.client.filter does not exist
import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
^
Is this because names have changed between versions? Which version did you use? Could you point me to where I can get jars?
Thanks for your help
Nathan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.