Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在JIRA插件中包含JIRA REST Java客户端?_Jira_Jira Plugin_Jira Rest Java Api - Fatal编程技术网

如何在JIRA插件中包含JIRA REST Java客户端?

如何在JIRA插件中包含JIRA REST Java客户端?,jira,jira-plugin,jira-rest-java-api,Jira,Jira Plugin,Jira Rest Java Api,我是JIRA插件开发新手,所以我的问题听起来可能太简单了,但请耐心仔细阅读,因为我已经尝试了很多东西,在互联网上找到了,但没有一个有效。这就是为什么我在这里问它,作为我最后的希望 我想在我的JIRA插件中使用。直截了当的建议是将以下内容添加到我的pom.xml中,一切都应该正常工作: <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-rest-ja

我是JIRA插件开发新手,所以我的问题听起来可能太简单了,但请耐心仔细阅读,因为我已经尝试了很多东西,在互联网上找到了,但没有一个有效。这就是为什么我在这里问它,作为我最后的希望

我想在我的JIRA插件中使用。直截了当的建议是将以下内容添加到我的pom.xml中,一切都应该正常工作:

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client</artifactId>
    <version>1.1-m02</version>
</dependency>
我得到异常
java.lang.NoClassDefFoundError:com/atlassian/jira/rest/client/internal/jersey/JerseyJiraRestClientFactory

我重复一遍,在Eclipse中,一切都显示正常,没有一个警告/错误标记,但在运行时,我得到了那个异常

向我推荐的解决方案是将pom.xml添加到我的pom.xml中,我确实这样做了,但是我甚至无法正常启动JIRA,因为有太多的异常(如果需要,将提供它们)

所以,简单的问题是如何正确地做到这一点?更好的是,有没有人可以提供pom.xml文件+src/文件夹的简单工作示例,这样我就可以知道我错在哪里了

提前非常感谢。

如本文所述,当前版本的JRJC is 2.0,提供的pom.xml文件中提到了一件重要的事情:

“JIRA已经提供了许多JRJC需要的依赖项。我们需要将它们从JRJC依赖项中排除,因为我们不想将它们打包到插件中。”

因此,解决方案是从JRJC依赖项中排除这些内容:

<dependency>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-rest-java-client</artifactId>
        <version>2.0.0-m2</version>
        <!--
        JIRA will already provide a number of dependencies that JRJC needs. We need to exclude them from the
        JRJC dependency as we don't want to package them up inside the plugin.
        -->
        <exclusions>
                <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>joda-time</groupId>
                        <artifactId>joda-time</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.sun.jersey</groupId>
                        <artifactId>jersey-json</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.atlassian.sal</groupId>
                        <artifactId>sal-api</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.atlassian.event</groupId>
                        <artifactId>atlassian-event</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>commons-codec</groupId>
                        <artifactId>commons-codec</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.sun.jersey</groupId>
                        <artifactId>jersey-core</artifactId>
                </exclusion>
        </exclusions>
</dependency>

com.atlassian.jira
jira rest java客户端
2.0.0-m2
公用记录
公用记录
乔达时间
乔达时间
泽西岛
泽西json
番石榴
番石榴
com.atlassian.sal
沙拉皮
com.atlassian.event
大西洋事件
org.slf4j
slf4j api
公地郎
公地郎
通用编解码器
通用编解码器
org.springframework
spring上下文
泽西岛
球衣核心

这可能不是对您问题的直接回答,但可能会为您提供一些正确方向的线索

吉拉挥舞着一把双刃剑,OSGI容器。在本地环境中开发时看起来不错的东西在部署时会爆炸。您可能有幸从OSGI的角度追踪到一些事情。我去过那里,被烧了几次。嗯

<dependency>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-rest-java-client</artifactId>
        <version>2.0.0-m2</version>
        <!--
        JIRA will already provide a number of dependencies that JRJC needs. We need to exclude them from the
        JRJC dependency as we don't want to package them up inside the plugin.
        -->
        <exclusions>
                <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>joda-time</groupId>
                        <artifactId>joda-time</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.sun.jersey</groupId>
                        <artifactId>jersey-json</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.atlassian.sal</groupId>
                        <artifactId>sal-api</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.atlassian.event</groupId>
                        <artifactId>atlassian-event</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>commons-codec</groupId>
                        <artifactId>commons-codec</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context</artifactId>
                </exclusion>
                <exclusion>
                        <groupId>com.sun.jersey</groupId>
                        <artifactId>jersey-core</artifactId>
                </exclusion>
        </exclusions>
</dependency>