Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using stash-scm-git-api with Maven

Alexandre Mutel May 20, 2013

Hi,

I have created a stash plugin and stash-plugin-module using the command available in the atlassian sdk: atlas-create-stash-plugin.bat / atlas-create-stash-plugin-module.bat

I would like to use the stash-scm-git-api, so I tried to add the following code to the pom file of my project:

<dependency>
    <groupId>com.atlassian.stash</groupId>
    <artifactId>stash-scm-git-api</artifactId>
    <scope>provided</scope>
</dependency>

But the stash-scm-git-api is not found by maven.

How can I reference this API in a Maven project? I have installed Stash2.4.1 but I don't know how I can make a pom.xml file aware about the JAR to lookup.

Thanks!

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
cofarrell
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.
May 20, 2013

Hi Alex,

How are you running maven? If you're using raw mvn you will need the Atlassian repositories in your settings.xml, otherwise try using 'atlas-mvn' which has the correct configuration. This is the artifact from our maven repository.

https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/stash/stash-scm-git-api/2.4.1/

Cheers,

Charles

0 votes
Alexandre Mutel May 20, 2013

Great, thanks for your quick answer.

In fact, I'm developing from IDEA Intelij, by importing the Maven project pom.xml that was created by atlas-* commands. Eveything seems to be correctly imported, and I was able to compile the default stash project with it.

Is the "settings.xml" located in $(atlassian.sdk\apache-maven\conf ?

As I understand, there is a Maven repository in my $(UserProfile)\.m2. I can see some of the stash jar there. How can I download and install the artifact from the URL you give me?

I'm really sorry about this dumb question, I'm completely new to this Maven thing (but I did lots of Java 15 ago, but at this time, Maven was not available yet).

cofarrell
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.
May 20, 2013

I might be templated to run 'atlas-mvn compile' again, which will download/cache the git-api artifact, and then refresh IDEA. I think that will allow IDEA to find the correct artifact without you having to modify your settings.xml.

Otherwise some more information:

https://developer.atlassian.com/display/DOCS/Atlassian+Maven+Repositories

https://developer.atlassian.com/display/DOCS/Verifying+Your+Maven+Settings

In any case don't manually add things to the .m2 directory, that will cause you no end of trouble.

Alexandre Mutel May 20, 2013

Great! running "atlas-mvm compile" download and install the packages.

Thanks

TAGS
AUG Leaders

Atlassian Community Events