Maven setup for SDK and FastDev

Andrzej Jarzabek April 7, 2014

Hi,

This issue looks like a problem with FastDev, but it's also possible I've got something set up in my system that causes this.

I'm using Atlassian Plugin SDK 4.2.19 with FastDev 2.4. When FastDev attempted to rebuild my plugin, I got this error:

Downloading: http://repo1.maven.org/maven2/com/atlassian/maven/plugins/atlassian-pdk/2.3.1/atlassian-pdk-2.3.1.pom

[INFO] Unable to find resource 'com.atlassian.maven.plugins:atlassian-pdk:pom:2.3.1' in repository central (http://repo1.maven.org/maven2)

[ERROR] Unable to complete running command: tpi

java.lang.RuntimeException: org.apache.maven.plugin.MojoExecutionException: Unable to execute mojo

at org.twdata.maven.cli.commands.ExecuteGoalCommand.run(ExecuteGoalCommand.java:112)

[…]

Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'com.atlassian.maven.plugins:atlassian-pdk': POM 'com.atlassian.maven.plugins:atlassian-pdk' not found in repository: Unable to download the artifact from any repository

com.atlassian.maven.plugins:atlassian-pdk:pom:2.3.1

from the specified remote repositories:

central (http://repo1.maven.org/maven2)

for project com.atlassian.maven.plugins:atlassian-pdk

When I used Maven to get the artifact manually, I stopped getting the error and everything works fine. However, the error message suggests that the Maven session launched from FastDev ignores the Maven settings bundled with the SDK (which would point Maven at Atlassian public repository instead of Maven central repo). I'm guessing many people wouldn't have noticed this, because they had the atlassian-pdk artifact downloaded previously to their local repo.

3 answers

1 accepted

0 votes
Answer accepted
Andrzej Jarzabek April 27, 2014

I tried with SDK 4.2.20 freshly installed on a different system, and could not reproduce the issue - Maven now went to Atlassian Public repo. When running unconfigured behind a proxy it is unable to download the components, but in the error message it does say that it tried downloading from atlassian-public (https://maven.atlassian.com/repository/public) as well as Maven central. This confirms that it's not a proxy issue. Possibly it has been fixed since by either SDK 4.2.20 update or some new versions in the Maven repo; or it may be due to some peculiar setup on the machine where I saw it manifest. In nay case, it appears it's no longer an issue.

0 votes
Andrzej Jarzabek April 7, 2014

I am behind a proxy, but that is not the cause. The bundled Maven is already correctly configured to go through the proxy and the JVM options are set. Note that I don't get any problems downloading dependencies or running my plugin in an embedded Jira, the only problem I get is when I make changes to my Plugin and try to make FastDev reload it, either through running tests through the Plugin test Console, or by clicking the "scan and reload" button on the Dev Toolbox bar. I understand this launches a separate instance of Maven to rebuild my plugin before redeploying it.

I think it's also quite unlikely that the issue would be due to the proxy, given that the error message complains about not being able to find the plugin in the Maven central repository (http://repo1.maven.org/maven2) - it wsould not find it there even if there was no proxy, because the artifact isn't there. To find it, Maven would have to go to the Atlassian public repo (https://maven.atlassian.com/repository/public) - if it did try there, but was blocked by the proxy, I would expect to see an error message about that, but there isn't one.

I have tried to put the proxy settings directly into the mvn.bat bundled in the Atlassian SDK toolkit, but, as expected, it didn't help either.

0 votes
Nadir MEZIANI
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.
April 7, 2014

Hi,

I think that you are behind proxy.

Try to configure it in setting.xml

https://answers.atlassian.com/questions/149242/proxy-setup-for-jira-plugin-development

Andrzej Jarzabek April 7, 2014

I am behind a proxy, but that is not the cause. The bundled Maven is already correctly configured to go through the proxy and the JVM options are set. Note that I don't get any problems downloading dependencies or running my plugin in an embedded Jira, the only problem I get is when I make changes to my Plugin and try to make FastDev reload it, either through running tests through the Plugin test Console, or by clicking the "scan and reload" button on the Dev Toolbox bar. I understand this launches a separate instance of Maven to rebuild my plugin before redeploying it.

I think it's also quite unlikely that the issue would be due to the proxy, given that the error message complains about not being able to find the plugin in the Maven central repository (http://repo1.maven.org/maven2) - it wsould not find it there even if there was no proxy, because the artifact isn't there. To find it, Maven would have to go to the Atlassian public repo (https://maven.atlassian.com/repository/public) - if it did try there, but was blocked by the proxy, I would expect to see an error message about that, but there isn't one.

I have tried to put the proxy settings directly into the mvn.bat bundled in the Atlassian SDK toolkit, but, as expected, it didn't help either.

Nadir MEZIANI
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.
April 7, 2014

try to reload changes with this command in console

atlas-cli --jvmargs -Dhttp.proxyHost=your proxy -Dhttp.proxyPort=port -Dhttps.proxyHost=your proxy -Dhttps.proxyPort=port

Andrzej Jarzabek April 7, 2014

"Unable to parse command line options: Unrecognized option: --jvmargs"

BTW I'm already running altas-* commands with these arguments (set through ATLAS_OPTS, but I did experiment with setting them directly in batch files as well). What makes you think this is a proxy issue?

Nadir MEZIANI
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.
April 7, 2014

hi,

you can replace atlas-cli by atlas-run and when jira start try to execute fastdev

Andrzej Jarzabek April 7, 2014

I have already done that, and, like I wrote before, it doesn't work because it's not a proxy issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events