Installing Atlassian SDK with NetBeans

To create custom plugins and functionality for Atlassian products, you can download and use the Atlassian plugin SDK following instructions here : https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK

The key part is to add the atlassian SDK BIN directory to your path.

After the plugin project is initially created the Maven project comes up as “unloadable” in the NetBeans Projects window. Also, nodes like “Source Packages” do not show up.

Next, the official instructions here say that once you generate a new project, the Maven POM for that project needs to be modified as specified here : https://developer.atlassian.com/display/DOCS/Configuring+NetBeans+to+use+the+Atlassian+Plugin+SDK

It states “In order for NetBeans to pick up the necessary files to recognize this correctly you need to add the following to the project’s pom.xml” like this :

<repositories>
<repository>
<id>atlassian</id>
<name>Atlassian Repository</name>
<url></url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>atlassian-public</id>
<url></url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

I thought it was odd that the URL tag would be empty.

And in the properties section of the POM I added this :

<maven.local.repo>C:Atlassianatlassian-plugin-sdk-3.2repository</maven.local.repo>

However when both in NetBeans and via the atlas-mvn on command line I run the install goal to build the project it complains that the URL tag is empty and should not be.

Searching Atlassian’s Answers site, I found another person complaining of this issue : https://answers.atlassian.com/questions/22694/netbeans-complains-repositories-repository-atlassian-url-is-missing

There was no answer, so I just decided to enter an arbitrary value for the URL.

<url>foo</url>

Additionally I also realized when they said to use the Atlassian SDK repository in the <maven.local.repo> property they weren’t kidding. I had pointed NetBeans to use that version of Maven (via Tools > Options > Miscellaneous > Maven. I assumed this would work, but apparently not, thus requiring the <maven.local.repo> property to explicitly define the Atlassian-provided repository.

After making these changes the NetBeans project went from being “unloaded” to looking “normal” in the project window.

I could then clean and build it correctly directly in NetBeans without having to use the atlas-mvn on the command line.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>