In this recipe, we will quickly see how we can create a Java client to communicate with JIRA using the REST APIs.
Create a simple Java project. You can use the maven archetype, maven-archetype-quickstart
, to create the project or use your favorite IDE to generate one.
The following is the non-interactive command for generating a simple project using maven-archetype-quickstart:
mvnarchetype:generate -DgroupId=com.jtricks
-DartifactId=rest-client -DarchetypeArtifactId=maven-archetype-quickstart
-DinteractiveMode=false
You can easily generate an Eclipse project using the following command:
mvn eclipse:eclipse
In order to connect to JIRA using REST APIs, Atlassian has developed the JRJC library. It provides a thin layer of abstraction on top of the REST API and related HTTP(S) communication, and gives a domain object model to represent the JIRA entities, such as issues, priorities, resolutions, statuses, users, and so...