Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use JIRA REST client library?

I need to use JIRA REST client version 5.2.0 or higher. Cloud JIRA does not work with an earlier version of the client.

In my pom.xml file I have the following dependencies:

<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-rest-java-client-app</artifactId>
    <version>5.2.1</version>
</dependency>

When I building the project, I get an exception like this:

Failed to execute goal on project XXXXXXXXX: Could not resolve dependencies for project  XXXXXXXXXX:jar:XXXX: Failed to collect dependencies at com.atlassian.jira:jira-rest-java-client-core:jar:5.2.1: Failed to read artifact descriptor for com.atlassian.jira:jira-rest-java-client-core:jar:5.2.1: Could not find artifact com.atlassian.platform:platform:pom:3.1.7 in MY_REPO (http://XXXXXXXXXX/repository/maven-public) -

com.atlassian.platform:platform:pom:3.1.7 is not listd at mvnrepository. There are versions 3.1.12 and 3.1.17, but not 3.1.7. Someone told me that version 3.1.7 might have had a security-related bug and was therefore removed by Atlassian.

Both jira-rest-java-client-app and jira-rest-java-client-core are children of jira-rest-java-client-parent, which uses version 3.1.7 of the platform:

    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-rest-java-client-parent</artifactId>
    <version>5.2.1</version>
    <packaging>pom</packaging>

    [...]

    <properties>
        <platform.version>3.1.7</platform.version>

        [...]

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.platform</groupId>
                <artifactId>platform</artifactId>
                <version>${platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

5.2.1 seems to be the latest version of both jira-rest-java-client-core and jira-rest-java-client-app.

How can I use the JIRA REST client (for programmatically creating issues in Cloud JIRA) when it uses a version of the library that is not available any more?

I tried to exclude the platform in the dependencies and to specify another version in depencency management sections. This did not help.

like image 527
Dmitrii Pisarenko Avatar asked Jan 25 '23 06:01

Dmitrii Pisarenko


1 Answers

If you have a look at the repository

https://packages.atlassian.com/mvn/maven-external

from atlassian, you find the desired artifact com.atlassian.platform:platform:pom:3.1.7there. Since this repository seems to be from atlassian, I see no reason to believe that they recommend not to use the version.

This is also discussed in https://community.atlassian.com/t5/Jira-questions/Jira-rest-java-client-core-5-1-and-fugue-2-7-0-breaks-build/qaq-p/1151091

like image 138
J Fabian Meier Avatar answered Jan 29 '23 14:01

J Fabian Meier