Atlassian SDK 9.0.2 Error when using atlas-mvn install

With the new SDK Version 9.0.2, I get the following Error when trying to install the dependencies:

[ERROR] Failed to read artifact descriptor for jndi:jndi:jar:1.2.1
[ERROR]         Caused by: The following artifacts could not be resolved: jndi:jndi:pom:1.2.1 (present, but unavailable): Could not transfer artifact jndi:jndi:pom:1.2.1 from/to tmatesoft (https://maven.tmatesoft.com/content/repositories/releases/): status code: 403, reason phrase: Forbidden (403)
[ERROR] Failed to read artifact descriptor for jta:jta:jar:1.0.1
[ERROR]         Caused by: The following artifacts could not be resolved: jta:jta:pom:1.0.1 (present, but unavailable): Could not transfer artifact jta:jta:pom:1.0.1 from/to tmatesoft (https://maven.tmatesoft.com/content/repositories/releases/): status code: 403, reason phrase: Forbidden (403)

As a result I’m currently not able to work on the DC Environment. It may be related to this issue:
https://jira.atlassian.com/browse/JRASERVER-43031
The workaround mentioned there seems not to work for me and I would need to downgrade the SDK Version

2 Likes

I had the same issue in my pipelines and I have a dirty trick that worked for me, it’s not very elegant but maybe it’s good enough.
If you open the Atlassian SDK tar.gz, you’ll find a repository directory. If you copy its content in your ~/.m2/repository, or at least the jndi and jta directories, it should work.

2 Likes

Hi @m.herrmann,

You can find the dependencies in jira-core Index of maven-external/com/atlassian/jira/jira-core/9.12.0

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-core</artifactId>
    <version>9.12.0</version>
    <scope>provided</scope>
</dependency>

We don’t use this dependency only for this lib but the advantage is that like this, the dependency will always be available.

Fabien

The approach to copy jndi, did not work as I got this error message

[INFO] Artifact jndi:jndi:pom:1.2.1 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from

Maven seems to detect that while jndi is in my local repository, it’s no longer possible to download it and as a result abort with the initial error message. This can be reproduces by creating a new plugin using “atlas-create-jira-plugin” and adding jira-core as a dependency.

As there is still no fix from atlassian, I created a support ticket and modified my maven settings.xml as a workaround.
Replace the <profile> Part from your 9.0.2 maven settings.xml with the downloadable 8.2.10 version

1 Like

If you copy its content in your ~/.m2/repository , or at least the jndi and jta directories, it should work.

This does not work.

The root cause is that https://maven.tmatesoft.com/content/repositories/releases/ is not publicly available any longer. It requires login and password to be provided.

So you should open the Maven config file atlassian-plugin-sdk-9.0.2/apache-maven-3.9.8/conf/settings.xml and comment out the private Tmatesoft repository:

<settings...>
  ...
  <profiles>
    ...
    <profile>
      <id>defaultProfile</id>
      ...
      <repositories>
      ...
      <!-- See details at: https://community.developer.atlassian.com/t/atlassian-sdk-9-0-2-error-when-using-atlas-mvn-install/82804
      <repository>
        <id>tmatesoft</id>
        <name>Tmatesoft</name>
        <url>https://maven.tmatesoft.com/content/repositories/releases/</url>
      </repository>
      -->
      ...
      </repositories>
      ...
     </profile>
    ...
  </profiles>
  ...
</settings>

I don’t know what would be affected by commenting this out. But I can tell for sure that now the building process works without errors for my plugins.

4 Likes

Hey,

Thanks for reporting this, I’ll make the team aware this is a problem in the SDK 9.0.2 installer.

The SDK installer adds a bunch of repos to the Maven settings to make things easy, unfortunately it lead to this bug. The reason why was to smooth over this change: https://developer.atlassian.com/server/framework/atlassian-sdk/maven-package-mirrors/

In the linked document, watch out for the settings.xml example and the localrepo>:

<localRepository>localrepo></localRepository>

1 Like

Thanks, a fixed version should be published shortly

1 Like

What worked for me in the end was to copy the files from AMPS repository to my local ~/.m2 and then removing/commenting out contents of _remote.repositories.

cp -r /opt/atlassian-plugin-sdk-9.0.2/repository/jndi /opt/atlassian-plugin-sdk-9.0.2/repository/jta ~/.m2/repository/
rm -rf ~/.m2/repository/jndi/jndi/1.2.1/_remote.repositories ~/.m2/repository/jta/jta/1.0.1/_remote.repositories
1 Like

I updated to 9.1.1 but still get an error when using jira-core as a dependency, so you still need to fix it manually

[ERROR] Failed to execute goal on project sdkTest: Could not resolve dependencies for project aptis:sdkTest:atlassian-plugin:1.0.0-SNAPSHOT
[ERROR] dependency: jndi:jndi:jar:1.2.1 (provided)
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repo1.maven.org/maven2/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-central has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://packages.atlassian.com/artifactory/maven-atlassian-all/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of atlassian-proxy has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repo.terracotta.org/maven2/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of terracotta has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://plugins.gradle.org/m2/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of gradle-plugins has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://maven.anypoint.mulesoft.com/api/v1/maven/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of mulesoft has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://releases.aspose.com/java/repo/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of aspose has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://clojars.org/repo/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of clojars has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repository.sonatype.org/content/repositories/forge/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sonatype forge has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repository.mulesoft.org/releases/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of mulesoft-releases has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repository.mulesoft.org/nexus/content/repositories/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of mulesoft-public has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repo.typesafe.com/typesafe/releases/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of typesafe has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repo.jenkins-ci.org/releases/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jenkins-releases has elapsed or updates are forced
[ERROR]         jndi:jndi:jar:1.2.1 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

I solved that problem by excluding jira-core’s dependencies.

thx, worked for me :slight_smile:

which exactly?

I’ve added exclusions for jta, jndi, jcaptcha-api for the jira-core dependency, and an exclusion for jta in the jira-api dependency.

example for jira-core.

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-core</artifactId>
    <version>8.5.1</version>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>jta</groupId>
            <artifactId>jta</artifactId>
        </exclusion>
        <exclusion>
            <groupId>jndi</groupId>
            <artifactId>jndi</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.octo.captcha</groupId>
            <artifactId>jcaptcha-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>
1 Like

Bad solution, because Java won`t load some classes without JNDI.
Better will be:

Leave dependecy as it is
...
     <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
     </dependency>
...
And add the local repo which contains JNDI, JTI and captcha already

 <repositories>
        ...
        <repository>
            <id>atlassian-plugin-sdk</id>
            <url>file://${env.ATLAS_HOME}/repository</url>
        </repository>
 </repositories>

Environment variable should be set for $ATLAS_HOME