Main Contents

IntelliJ for Atlassian Plugin Development

September 26, 2014

I had some trouble setting up IntelliJ with the Atlassian SDK.  Time to contribute!

Maven Dependency Resolution

Initially the generated sample project had compile and POM errors flagged in Intellij.

First I tried cribbing from the Netbeans instructions by adding the Atlassian repos to my POM.  No dice.

I decided to start over.  In the Import Project dialog I saw there are settings for the Maven environment.  Eureka!

Iijamps-MavenEnv1

Iijamps-MavenEnv2

Iijamps-MavenEnv3

Later you can find these settings at Preferences -> Maven

Run Inside the IDE

From the docs… “While it’s possible to run the Atlassian Plugin SDK commands from within IDEA as custom run commands, in practice, most developers simply use IDEA for code editing and debugging, and use a separate console to run the atlas-run, atlas-debug, or other Atlassian Plugin SDK command.”

I don’t want to be snarky but… maybe that’s because it’s not documented?  I don’t love remote debugging, it’s more steps and multiple tools.  I love the way IntelliJ hyperlinks class references in console output so stack trace investigation is one click away.  Errors in startup output are hyperlinked too.  It’s a waste of time to copy-paste a bunch of code references from my terminal.  Looking at the atlas-run script it’s nothing fancy, just $MAVEN_OPTS, etc.  See https://developer.atlassian.com/display/DOCS/atlas-mvn

Here’s how you do it.

  1. In the IntelliJ Run/Debug Configurations add a new Maven runner.
  2. Working directory should be your project directory
  3. Command line should be com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:5.0.4:run –global-settings ${M2_HOME}/conf/settings.xml
    • Important: The placeholder M2_HOME doesn’t work… you have to replace it with the “Maven home directory” value from Preferences -> Maven

Hrm… it runs fine but didn’t stop at the breakpoint for my plugin.

Debug Inside the IDE

I haven’t figured this out yet.  I’ll update the post after I start my new job at Atlassian on Monday!

Filed under: Uncategorized | Comments (0)

Leave a comment

Login