lang.IllegalStateException:ComponentAccessor 尚未初始化。 这不会发生在生产系统上。开发人员 在单元测试中遇到此消息应阅读文档 用于 jira-tests 工件中的 MockComponentWorker 以获取更多信息 关于导致此错误的原因以及解决方法。
如何初始化ComponentAccessor 这是我的 pom.xml 供参考
<dependency>
<groupId>com.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>2.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.overzealous/remark -->
<dependency>
<groupId>com.overzealous</groupId>
<artifactId>remark</artifactId>
<version>1.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jndi/jndi -->
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>6.2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>6.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>atlassian-jira</artifactId>
<version>6.0-m05</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-app</artifactId>
<version>5.2.1</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>5.2.1</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-components</artifactId>
<version>5.0.1-rc1</version>
<type>pom</type>
<scope>provided</scope>
Atlassian-公共
https://packages.atlassian.com/maven/repository/public
下面是代码
IssueManager issueManager = ComponentAccessor.getIssueManager();
MutableIssue m = issueManager.getIssueObject(issueObj.getKey());
m.setAssigneeId("557058:0fa57746-30a2-498c-9e34-9306679d0be7");
为什么根据我的链接显示错误 ComponentAccessor 在 jira 6.0 版之后自行初始化 任何人都可以帮助我哪里出错了。 提前致谢!!