In my JIRA plugin I want to GET an external resource from 3rd party site (for example https://api.twitter.com/1.1/statuses/mentions_timeline.json?count=2&since_id=14927799, but much simpler).
After I was unable to make an HTTP request directly from JIRA I made my choice for Jersey (Jira REST API uses it too). I defined my simple resource
@XmlRootElement public class ValidatorResource { public String response; //yes, no public ValidatorResource(String response){ this.response = response; } }
And according to Jersey tutorial I configured a client for retrieving it as JSON:
ClientConfig client_config = new DefaultClientConfig(); client_config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); Client client = Client.create(new DefaultClientConfig());
But both Eclipse and Jira tell me that:
"The type com.sun.jersey.core.util.FeaturesAndProperties cannot be resolved. It is indirectly referenced from required .class files"
I am not a maven guru, it should be something with dependencies. After hours of googling I am giving up. My plugin dependencies are:
<dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> <version>1.1.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>1.13</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.13</version> </dependency>
Hi Peter, Hi Maxim,
did you try to include atlassians version of jersey? I was sucessful with the following modifications to my pom:
First add atlassians maven repository
<project> ...... <repositories> <repository> <id>atlassian-public</id> <url>https://maven.atlassian.com/repository/public</url> </repository> </repositories> ..... </project>
Second add dependencies to the atlassian version
<dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.8-atlassian-11</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>1.8-atlassian-11</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-core</artifactId> <version>1.8-atlassian-11</version> </dependency>
Keep me updated if it works.
Best regards Philipp
Hello!
Do you resolve your problem? At this moment I have same problem. It will be great, if you can help me. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.