我正在关注JRJC教程,以及这里的第二行:
final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, username, password);
抛出这个:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/client/apache/config/ApacheHttpClientConfig at com.atlassian.jira.rest.client.internal.jersey.JerseyJiraRestClientFactory.create(JerseyJiraRestClientFactory.java:34)
...
Caused by: java.lang.ClassNotFoundException: com.sun.jersey.client.apache.config.ApacheHttpClientConfig
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
我在我的 pom 中需要这样的 Jersey:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9</version>
</dependency>
它构建没有任何问题(mvn assembly:single,因为我需要一个独立的 jar)。任何想法这里出了什么问题?