我正在尝试构建 JIRA 7 插件(邮件处理程序)。在关于如何构建一个的官方教程中,他们为选项对话框构建了这样的类:
public class EditDemoHandlerDetailsWebAction extends AbstractEditHandlerDetailsWebAction {...}
我的问题是,与此同时,有些事情似乎发生了变化。我的 IDE 建议要么使此类抽象,要么从父类(super class) (AbstractEditHandlerDetailsWebAction) 实现更多方法。
当我实现缺少的类时,我无法再构建我的项目并收到此错误:
name clash: setErrorMessages(java.util.Collection) in com.example.plugins.jira.demomailhandler.EditDemoHandlerDetailsWebAction and setErrorMessages(java.util.Collection) in webwork.action.ActionSupport have the same erasure, yet neither overrides the other.
有人知道我做错了什么以及如何在 2017 年做到这一点吗?
提前非常感谢您!
编辑#1 这里有一些关于我在 pom.xml 中使用的版本的更多信息:
<properties>
<jira.version>7.2.2</jira.version>
<amps.version>6.2.11</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<!-- TestKit version 6.x for JIRA 6.x -->
<testkit.version>6.3.11</testkit.version>
</properties>
以及邮件相关的依赖项:
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-mail-plugin</artifactId>
<version>9.0.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.mail</groupId>
<artifactId>atlassian-mail</artifactId>
<version>2.7.13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.4</version>
<scope>provided</scope>
</dependency>
最佳答案
添加这两个方法就足够了:
@Override
public void addError(String s, String s1) {}
@Override
public void addErrorMessage(String s) {}
我根本不需要添加setErrorMessages方法来让它工作。我的 IDE (IntelliJ) 仍在提示并在类名下画了一条红线,但目前一切似乎都正常。
关于java - JIRA 7+ 编辑邮件处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42423319/