How to setup com.atlassian.jira dependencies from repository with Eclipse

Paul Prendergast October 11, 2011

I have setup my atlassian sdk to be with Eclipse.

I tried to create a java file using com.atlassian.jira dependencies but got java errors saying the imports do not exist.

what is the correct way to do it with eclipse to recongize com.atlassian.jira* ?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Andy Brook [Plugin People]
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.
October 11, 2011

You need some useul things such as M2E for Eclipse, and could do worse than starting with the Atlassian SDK. To just start writing Java code without using Maven is going to be incredibly tough.

The Atlassian SDK is bundled with its own maven 2.10 binaries, it unforuntately doesn't work with Maven 3. If you are new to Maven, double the reason for following the SDK guide above.

Once you have a pom.xml, all dependencies will be 'realised' in Eclipse (ok, after a long wait whilst it downloads the universe).

Tricks: If you encounter difficulties, dont rely on Eclipse and M2E to download dependencies, it still has trouble in some scenarios. Always start off from the command line to pull in the bulk, once done, the IDE route works fine.

Paul Prendergast October 12, 2011

Andy or anyone,

Well I did install the SDK and followed the SDK setup and Eclipse setup. I have tried to do tutorial: https://developer.atlassian.com/display/DOCS/Plugin+Tutorial+-+Adding+your+own+Menu+Items+to+JIRA

and it worked.

But when I tried tutorial:https://developer.atlassian.com/display/DOCS/Plugin+Tutorial+-+Writing+Integration+Tests+for+your+JIRA+plugin

Importing did not find com.atlassian.jira.*.

dependencies with maven2 not set up.

I need to know how to setup maven to download JARs for com.atlassian.jira.

setting.xml and pom.xml examples would speed up my solution.

Andy Brook [Plugin People]
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.
October 13, 2011

With SDK in your path, you should be able to do 'atlas-create-jira-plugin' (follow prompts), then cd into that folder, and 'atlas-compile' to pull down main dependencies.

Its probable eclipse cannot locate the atlassian dependencies as you have not yet updated the Maven configuration in Eclipse to use the 'settings.xml' that details the repositories. This file is located in the SDK_HOME/apache-maven/conf/settings.xml

After importing the maven project into the eclipse workspace, judicious use of Update Project Configuration should kcik start dependencies to appear. At this point only, is it worth trying to write java code that imports packages.

Paul Prendergast October 13, 2011

Andy,

thanks for the update. I feel I am little bit clearer after looking through setting.xml and the POM.

After tracing the repository https://m2proxy.atlassian.com/repository/public and following the import path in the repository to the class I couldn't find it there. "com.atlassian.jira.issue.customfields.converters.DoubleCoverter" or others; So i couldn't make a dependency(s). IF my setting.xml is the basic file that comes with the SDK and have the only repository link(above), I would need another repository? Shouldn't the baisc sdk repository com with all the jira class to make example customfields for issues.

Paul Prendergast October 17, 2011

Actually I jist solved my problem....Dependenies just needed to be setup.

Thanks for the help

TAGS
AUG Leaders

Atlassian Community Events