Atlassian Plugin SDK requires its own Maven settings, JDK version and set of environment variables (like ATLAS_HOME) to work.
If you're already an advanced user of Eclipse and Maven you may already have a customized setup that you don't want to modify in favor of Atlassian PSDK requirements.
It's possible to isolate all Atlassian setup with a simple
shell script that will create a temporary new shell
with
proper environment for Atlassian plugin development and without any
effect on the rest of your system.
Recommendations are for Windows platform, but it should be easy enough to apply them for Linux users.
Configuration instructions
- Choose a location for PSDK files
- Download Atlassian Plugin SDK
- Configure PSDK Maven to use custom user settings location
- Edit %ATLAS_HOME%\apache-maven\bin\mvn[.bat], modify command under the ":runm2" label by adding
"--settings %M2_HOME%\conf\user-settings.xml"
at the end of the command line
- Create apache-maven\conf\user-settings.xml file
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/settings/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${env.ATLAS_HOME}/repository</localRepository>
</settings>
- Create shell scriptset
JAVA_HOME=C:\dev\atlassian\jdk1.6.0_31
set ATLAS_HOME=C:\dev\atlassian\atlassian-plugin-sdk-3.10.4
set M2_HOME=%ATLAS_HOME%\apache-maven
set M2_REPO=%M2_HOME%\repository
set M2=%M2_HOME%\bin
set PATH=%JAVA_HOME%\bin;%ATLAS_HOME%\bin;%M2%;%PATH%
cmd
- Test that PSDK works
atlas-run-standalone --product jira
- Download Eclipse IDE for Java EE Developers
- Start Eclipse and configure workspace for your Atlassian projects
Optional steps
- Install m2eclipse, SVN, etc. and configure m2eclipse to use "external" PSDK Maven installation and user settings file.
- Download and attach Atlassian product source code. You need to have an account on http://my.atlassian.com to do that.
Eclipse and m2e configuration troubleshooting
- Error "Build path is incomplete. Cannot find the class file for com.atlassian.*"
Solution Verify that Window - Preferences - Maven - User settings - Local repository points to the same location that is specified in conf\user-settings.xml.
- Error "Plugin execution not covered by lifecycle configuration"
Solution Use "quick fix" suggestion to ignore all such errors