我对 JIRA 很陌生。在 Maven 中为 JRJC 添加了依赖项。我的场景是在我的 Java EE 应用程序中阅读问题。我创建了一个简单的类,例如 public class IssueCollector { public void readIssue(){
final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
try{
final URI jiraServerUri = new URI("http://localhost:8080//jira");
final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri,"username", "password");
final NullProgressMonitor pm = new NullProgressMonitor();
final Issue issue = restClient.getIssueClient().getIssue("AKE-1", pm);
System.out.println(issue);
}catch(Exception e){
System.out.println("URI not found");
}
}
}
但是当我跑步时,我会遇到异常,例如
java.lang.NoClassDefFoundError: com/atlassian/jira/rest/client/ProgressMonitor
com.vxl.appanalytix.dataload.fromEmail.GenericEmailAttachmentDownloder.downloadEmailAttachments(GenericEmailAttachmentDownloder.java:28)
com.vxl.appanalytix.controllers.controllerClasses.GenericEmailServiceClass.readEmailAttachments(GenericEmailServiceClass.java:13)
com.vxl.appanalytix.controllers.GenericEmailServiceServlet.doPost(GenericEmailServiceServlet.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
我是不是走错路了。必须创建 Web 服务而不是简单的 java 类