Maven dependency (com.atlassian.jira.plugins...)

Hello

In the java import (is a maven application) "com.atlassian.jira.plugins.importer.external.beans.ExternalCustomField" Eclipse shows the error "The import com.atlassian can not be resolved".

What needs to be put in pom.xml (dependency, repository ...)?

I am developing a plugin for Jira 6.0.1.

In the pom.xml I have included:

<plugin>
<groupId> com.atlassian.maven.plugins </ groupId>
<artifactId> maven-jira-plugin </ artifactId>
<version>? </ version>
<extensions> true </ extensions>
<configuration>
<productVersion>? </ ProductVersion>
<productDataVersion>? </ productDataVersion>
</ configuration>
</ plugin>

I do not know which version to market.

Thank you!

9 answers

2 votes
Philipp Steinwender
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.
July 28, 2013

Running the atlassian sdk's command does additional configuration of maven settings.

When running maven standalone, you are going to get the error "cannot resolve com.atlassian...".

Either run maven wrapped in the atlassian commands, or add additioanl configuration to your maven settings.xml or your pom.

Look into the code of the sdk to find details.

Have you added the atlassian maven repository?

Taken from sdk/apache-maven/conf/settings.xml:

...
...
       &lt;repositories&gt;
         &lt;repository&gt;
           &lt;id&gt;atlassian-public&lt;/id&gt;
           &lt;url&gt;https://maven.atlassian.com/repository/public&lt;/url&gt;
           &lt;snapshots&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/snapshots&gt;
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
         &lt;/repository&gt;
 	      &lt;repository&gt;
 	        &lt;id&gt;atlassian-plugin-sdk&lt;/id&gt;
           &lt;url&gt;file://${env.ATLAS_HOME}/repository&lt;/url&gt;
           &lt;snapshots&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
           &lt;/snapshots&gt;
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
         &lt;/repository&gt;
       &lt;/repositories&gt;
 
       &lt;pluginRepositories&gt;
         &lt;pluginRepository&gt;
           &lt;id&gt;atlassian-public&lt;/id&gt;
           &lt;url&gt;https://maven.atlassian.com/repository/public&lt;/url&gt;
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
           &lt;snapshots&gt;
             &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/snapshots&gt;
         &lt;/pluginRepository&gt;
         &lt;pluginRepository&gt;
           &lt;id&gt;atlassian-plugin-sdk&lt;/id&gt;
           &lt;url&gt;file://${env.ATLAS_HOME}/repository&lt;/url&gt;
           &lt;releases&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
             &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
           &lt;/releases&gt;
           &lt;snapshots&gt;
             &lt;enabled&gt;true&lt;/enabled&gt;
           &lt;/snapshots&gt;
         &lt;/pluginRepository&gt;
       &lt;/pluginRepositories&gt;
       &lt;properties&gt;
         &lt;downloadSources&gt;true&lt;/downloadSources&gt;
         &lt;downloadJavadocs&gt;true&lt;/downloadJavadocs&gt;
       &lt;/properties&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
...

0 votes

I do not use the Atlassian SDK because throws an error with the class org.codehaus.classworlds.Launcher (class not found or loaded)

0 votes
Philipp Steinwender
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.
July 29, 2013

Is there a reason for not using the SDK?

It is quite easy to install and may get your setup working.

See: https://developer.atlassian.com/display/DOCS/Set+up+the+Atlassian+Plugin+SDK+and+Build+a+Project

0 votes

Thanks Philipp! I added the repositories and repositories plugins to settings.xml and Maven has been downloaded many artifacts, but imports continue failing, the "com.atlassian.jira.plugins..." and "com.example.plugins ..." imports.

Can be for not using the Atlassian SDK?

Thank you!

0 votes

Thanks rambanam and Philipp!

The last dependency has not solved the problem (I already used the r03 version of it).

I'm not using the Atlassian SDK, but I have run the same commands in Maven: "eclipse: eclipse" and "package", and clean the project in ecilpse, refresh, close&open...

Desperate!

0 votes
Philipp Steinwender
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.
July 22, 2013

Maybe try to build your plugin with

atlas-mvn package

from terminal, then the atlassian deps will be resolved. Don't know if this is done differently with eclipse.

After this, the deps should be available from your local maven repo.

0 votes
RambanamP
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.
July 22, 2013

try with following code

&lt;dependency&gt;
 &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
 &lt;artifactId&gt;guava&lt;/artifactId&gt;
&lt;version&gt;10.0.1&lt;/version&gt;
&lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt; org.apache.httpcomponents &lt;/ groupId&gt;
&lt;artifactId&gt; httpcore &lt;/ artifactId&gt;
&lt;version&gt; 4.0.1 &lt;/ version&gt;
&lt;scope&gt;provided&lt;/scope&gt;
&lt;/ dependency&gt;

RambanamP
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.
July 22, 2013

dont forget to run atlas-mvn eclipse:eclipse run once you change pom.xml

0 votes

Thanks rambanam prasad!

But this has not solved the problem. Some of the libraries not working right now used to work before.

The libraries that fail with the pom.xml that you show me are:

com.google ...

com.atlassian.jira.plugins ...

com.example.plugins ...

Previously I solved the com.google libraries with dependencies:

<dependency>

<groupId> com.atlassian.jira </ groupId>

<artifactId> jira-api </ artifactId>

<version> 5.0 </ version>

<scope> provided </ scope>

</ dependency>

<dependency>

<groupId> com.google.guava </ groupId>

<artifactId> guava </ artifactId>

<version> r03 </ version>

</ dependency>

<dependency>

<groupId> org.apache.httpcomponents </ groupId>

<artifactId> httpcore </ artifactId>

<version> 4.0.1 </ version>

</ dependency>

But with these I lack the following:

com.atlassian.jira.plugins ...

com.example.plugins ...

:(

Any idea?

0 votes
RambanamP
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.
July 21, 2013

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events