Maven Build Errors when running atlas-create-jira-plugin

Teck Kuoch September 27, 2019

I'm trying to create a HelloWorld plugin project as described here:

https://developer.atlassian.com/server/framework/atlassian-sdk/create-a-helloworld-plugin-project/

When I run

atlas-create-jira-plugin

I get the following:

[ERROR] Failed to execute goal com.atlassian.maven.plugins:jira-maven-plugin:8.0.2:create (default-cli) on project standalone-pom: Execution default-cli of goal com.atlassian.maven.plugins:jira-maven-plugin:8.0.2:create failed: 
Plugin com.atlassian.maven.plugins:jira-maven-plugin:8.0.2 or one of its dependencies could not be resolved: Failed to collect dependencies at com.atlassian.maven.plugins:jira-maven-plugin:jar:8.0.2 ->
com.atlassian.maven.archetypes:jira-plugin-archetype:jar:8.0.2 -> org.twdata.maven:mojo-executor:jar:2.3.0 -> org.apache.maven:maven-core:jar:3.5.4 -> org.apache.maven:maven-model:jar:3.5.4 ->
org.apache.commons:commons-lang3:jar:3.8.1: Failed to read artifact descriptor for org.apache.commons:commons-lang3:jar:3.8.1: Could not transfer artifact org.apache.commons:commons-lang3:pom:3.8.1 from/to atlassian-public (https://maven.atlassian.com/repository/public):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target -> [Help 1] 

 How do I proceed?

6 answers

1 vote
sukkeong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 9, 2021

Recently, using SDK8.0.16 to migrate plugins to JIRA8.13, I  encountered the same issue working through office network.

Overcame by pointing to proxy (provided by work IT)

Steps

So, if you are working from office network, try updating the configuration file in $atlas_home/apache-maven-$version/conf/settings.xml

Uncomment and update the '<proxy>' section with proxy setup by your company IT.

<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>

Check Repository

Regardless of needing to use a proxy, check and ensure that maven repo points to the following

<repository>
<id>atlassian-public</id>
<url>https://maven.atlassian.com/repository/public</url>
...
</repository>

Hope this helps

1 vote
blindbg May 6, 2020


The info about the error you are receiving is:
Could not transfer artifact org.apache.commons:commons-lang3:pom:3.8.1
from/to atlassian-public (https://maven.atlassian.com/repository/public):
And why is:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target -> [Help 1]

Solution seems:
Update your jvm JRE_HOME\lib\security\cacerts
Check for more info about that:
https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-779355358.html

What helped me to get forward with "missing dependencies" in 8.0.16 was to
replace my
~/.m2/settings.xml
with provided
atlassian-plugin-sdk-8.0.16\apache-maven-3.5.4\conf\settings.xml

but keeping my custom settings like proxies, google
Hope this helps.

Jeff_Swartz August 31, 2020

I ran into the same issue that was initially posted. What is unclear to me about updating my Java cacerts is which site does one specify for importing? Is it "apache.org" or some other site? I tried "apache.org" but still got the error.

fwoon November 5, 2020
- go to https://maven.atlassian.com/repository/public
- Export the certificate under details menu
- Save this as public.crt.
- run the below to import the crt into the cacert via keytool

keytool -import -alias atlasdk -keystore $JAVA_HOME/lib/security/cacerts -file <your public.crt filepath>

- Verify openssl works too:
openssl s_client -connect maven.atlassian.com:443 -servername maven.atlassian.com:443

However i still can't get this to work and are still getting this

(https://maven.atlassian.com/repository/public): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

0 votes
Pim Schrama October 7, 2021

I run into a sort like error and solved it by disabling the mirror section in my ~/.m2/settings.xml

0 votes
sukkeong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 4, 2020

Attempted to use the latest SDK (8.0.16) and came up with the same issue. After spending half the day debugging (and fighting) maven trying to find a resolution, giving up for the day.

Tried other version and here is the result:

  • 8.0.16 - fail
  • 8.0.7 - fail, same error
  • 8.0.6 - fail, same error
  • 6.3.12 - SUCCESS ! :)
  • 6.3.10 - current SDK that is still working.

 

So, maybe use the 6.3.12 version.
I got my copy here: https://marketplace.atlassian.com/apps/1210993/atlassian-plugin-sdk-tgz/version-history

0 votes
Akshatha December 26, 2019

Is the problem resolved? I am facing the same issue.

Karl Edwards December 26, 2019

Ah I figured it out but it's been a bit so I'm not sure I remember what I did specifically. What do you get when you enter atlas-version?

Akshatha December 26, 2019

Hi Karl

I get below for atlas-version

ATLAS Version: 8.0.16
ATLAS Home: /opt/atlassian-plugin-sdk-8.0.16
ATLAS Scripts: /opt/atlassian-plugin-sdk-8.0.16/bin
ATLAS Maven Home: /opt/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4
AMPS Version: 8.0.2
--------
Executing: /opt/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4/bin/mvn --version -gs /opt/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4/conf/settings.xml
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T00:03:14+05:30)
Maven home: /opt/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4
Java version: 13.0.1, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-13.0.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.1.3.el7.x86_64", arch: "amd64", family: "unix"
Karl Edwards December 27, 2019

I'm fairly new to this as well so I'll help the best I can but I'm not sure specifically what the problem is... it looks like your SDK & AMPS versions are up to date. You could try 'brew update' and then 'brew upgrade atlassian/tap/atlassian-plugin-sdk' just to make sure. Also once you've created an empty directory and navigated into that make sure you're running 'atlas-create-jira-plugin' and not 'atlas-create-jira-plugin-module'

If you're still having problems can you post the whole error that you're recieving?

Karl Edwards December 27, 2019

Wait! Actually I think I know what the problem is. Change your JDK to version 8. If you don't have it downloaded already you can get it here [https://adoptopenjdk.net] (or directly from Oracle but AdoptOpenJDK HotSpot is probably better if you don't know the differences between licenses). I'm fairly positive the Atlassian SDK is incompatible with JDK13 and maybe JDK11 as well.

 

After you download JDK 8, paste these lines (below) into your ~/.zshrc file if you're using ZSH, OR into your ~/.bash_profile if you're using BASH, etc. (make sure the path is what I have below, it should tell you in the last step of the JDK installation after downloading- if it's not the same, copy the path that it gives you)

 

export JAVA_HOME=$JAVA_HOME/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

Then find where your PATH is and paste '$JAVA_HOME/bin' after '$PATH', ie

export PATH="$PATH:$JAVA_HOME/bin"

 

Save & close, then source whichever file you put those into (for example 'source ~/.zshrc')

You can make sure everything is correct by opening a new window in your CLI and typing 'javac -version'; you should get output similar to 'javac 1.8.0_232'

or 'echo $JAVA_HOME' and get the output '/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home'

 

If all of that is correct you should have no problem creating a Jira plugin. Hope this helps! Here's the link with all of that info if you need:

[https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-linux-or-mac-system/]

Akshatha December 30, 2019

Hi Karl

Tried with lower version of java, but did not help.

#java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)

#javac -version
javac 1.8.0_232

#echo $JAVA_HOME
/usr/lib/jvm/jdk8u232-b09

#echo $PATH
/opt/atlassian-plugin-sdk/bin:/opt/atlassian-plugin-sdk/apache-maven/bin/:/usr/lib/jvm/jdk8u232-b09/bin:/usr/local/src/node-v10.14.2-linux-x64/bin:/usr/local/src/apache-maven/bin:/usr/bin:/usr/local/git/bin:/usr/lib64/qt-3.3/bin

Thanks

Akshatha

balaji Balasubramanian January 10, 2020

did you able to solve the problem?

i have the same issue

//balaji

0 votes
Karl Edwards December 15, 2019

Did you figure this out? I'm running into the same issue

Suggest an answer

Log in or Sign up to answer