当尝试使用JIRA Rest客户端从JIRA获取问题时,出现以下错误。
java.lang.NoSuchMethodError:javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
我正在使用的pom下方。
<properties>
<jersey-2-version>2.29</jersey-2-version>
<jaxrs.version>2.0.1</jaxrs.version>
</properties>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>${jersey-2-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>${jersey-2-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>${jersey-2-version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.26</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-api</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.20</version>
</dependency>
<dependency>
<groupId>io.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>4.7.2</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20151123</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.9</version>
</dependency>
</dependencies>
我正在尝试获取问题并通过rest api将其返回。
SearchResult searchJqlPromise =restClient.getSearchClient().searchJql("issuetype = Bug AND resolution = Unresolved ORDER BY created DESC%2C priority DESC%2C updated DESC").claim();
entity = new GenericEntity<Iterable<Issue>>(searchJqlPromise.getIssues())
{
};
有人可以向我发布要使用的JSon和其他库的确切版本。
答案 0 :(得分:0)
您可以尝试使用最新版本并进行检查吗? 您可以在maven pom.xml中使用以下依赖项。
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-api</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>5.1.0</version>
</dependency>
参考 您可以在mvnrepository.com中的链接下方进行引用。
https://mvnrepository.com/artifact/com.atlassian.jira/jira-rest-java-client-core/5.1.0 https://mvnrepository.com/artifact/com.atlassian.jira/jira-rest-java-client-api/5.1.0