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

Is it possible to use Maven 3 for the Atlassian SDK?

Jörg Thönnes December 11, 2012

According to the setup instruction for SDK it still uses Maven 2.

But within Eclipse Maven plugin m2e the current Maven 3.0.4 is the default.

Is it possible to use Maven 3.0.4 to build the SDK?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Ivan Maduro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 11, 2012

Hi Jörg,

It's technically possible to use Maven 3 with the SDK, however it's not officially supported. It's also missing some major features. There's currently a Ticket open to move to Maven 3. As Joseph Walton states in the ticket, it's possible to build with Maven 3.

However we definitely recommend staying with Maven 2 until it 3 supported and implemented.

Cheers,

Ivan.

Jörg Thönnes December 12, 2012

Thanks, Ivan.

Brett Ryan
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 16, 2013

What's the holdup on this? To tell you the truth I really hate working with the plugin SDK as it always conflicts my development environment while working on other non Atlassian product projects. I'd vouch that almost all Java developers have their own Maven and have to switch between it and the atlassian Maven configurations; it's more difficult when hosting your own maven repo (like Nexus) as it can't be used with the Atlassian SDK (well I've never got it to work).

joe
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2013

The holdup is amps:cli (AMPS-551). maven-cli-plugin needs work to be compatible with Maven 3 and one of the ideal alternatives (Mvnsh) isn't a drop-in replacement (or maintained). Personally, I use my own installation of Maven 3 to run the SDK's plugins, rather than the atlas- commands, but it wouldn't necessarily be appropriate for the SDK to force everyone to work like that.

Brett Ryan
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 17, 2013

Joseph, could you please tell me how to do this? I have been struggling and given up trying to get my setup to work. I want to acheive the following:

  1. Use our own maven (Nexus) server to proxy the atlassian repos.
  2. The SDK comes with artifacts that aren't in Atlassian Maven, getting these into the atlassian maven so they don't need to be distributed with the SDK would help.
  3. Needing to switch maven/java when working on atlassian always catches me out.
  4. Presently I have two ~/.m2/settings.xml files, I have to switch between the two depending if I'm working on atlassian plugins or other projects, eliminating this will be brilliant.
  5. Use maven tools within IDE (NetBeans)

If you have any documentation on this could you please link it.

joe
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 18, 2013

Sorry, I don't think this is documented, but I've opened AMPS-950. You should be able to:

  1. Add Atlassian's repo to Nexus
  2. Add those extra artifacts to your Nexus repository and point Maven to a group including those artifacts and Atlassian's repo.
  3. Add

    <pluginGroups>
    <pluginGroup>com.atlassian.maven.plugins</pluginGroup>
    </pluginGroups>

    to your settings.xml
  4. Use the amps: goals on the command line rather than the atlas- tools.

joe
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 10, 2013

There's some documentation now for this: Developing Plugins with Maven 3.

2 votes
brainicorn
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 14, 2013

FYI, AMPS 4.1.7 was just released and now let's you easily swap out maven executables without having to setup a nexus proxy or anything.

Simply set an environment variable called ATLAS_MVN and point it to your maven executable.

example:

export ATLAS_MVN=/usr/bin/maven3/mvn

Note: point it to the maven executable, NOT the maven home.

This will tell AMPS to use your custom executable, but will still use the SDK's built-in repo and settings.xml

This does NOT fix AMPS-551

Jannik Luyten
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.
August 19, 2013

Great Jonathan, tx!!

Can we go even further? Similar to this, isn't it a good idea to also allow the user to set the maven home as an environment variable?

Right now I point the atlassian-plugin-sdk-4.2.x/conf/settings.xml file to my ~/.m2/settings.xml, which I use point to our Nexus. This works, but I still have to recreate this symlink after each atlassian SDK update.

If the atlas- scripts would check for an environment variable like they do with ATLAS_MVN, we would no longer have to update our settings.xml every time an atlas update is done, as we could keep it pointed to our local settings.xml!

1 vote
Jeremy Goodwin November 26, 2013

For Brett's usecase, if he's happy keeping the local atlassian repository alongside his atlassian one, he'd also need to update the mirror entry in his "normal" settings file which default (http://books.sonatype.com/nexus-book/reference/maven-sect-single-group.html) sends everything to nexus. Nexus configuration states setting mirrorOf to *, but it will need to be changed to external:* so that it doesn't block the atlassian-plugin-sdk.

<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>external:*</mirrorOf>
<url>http://{yourNexusServer}/nexus/content/groups/public/</url>
</mirror>



This way, maven will let nexus handle the atlassian maven repo and the atlassian versions of artifacts (for example gson 2.2.2-atlassian-1) can still be handled by the localy installed sdk repo.

n.b. it would be good if Atlassian made their amended dependancies more easily available so nexus could handle them simply.

TAGS
AUG Leaders

Atlassian Community Events