Axa Assurance Maroc - Insurer Innovation Award 2024
AtlasCamp 2010: The Atlassian Plugin SDK For Fun & Profit - Ben Speakmon
1. The Atlassian Plugin
SDK For Fun & Profit
Ben Speakmon
Atlassian Developer Relations
Wednesday, November 3, 2010
2. Agenda
• Challenges in writing
plugins
• How the SDK fixes it
• SDK in action
• What’s new
• Getting involved
Wednesday, November 3, 2010
3. Plugin challenges
I am yours, you are mine
You are what you are
And you make it hard
--”Suite: Judy Blue Eyes”, Crosby, Stills & Nash
Wednesday, November 3, 2010
4. Effective plugin
development
• Different than product development
• Work within someone else’s sandbox
• Three things that MUST be easy:
• Starting the product
• Configuring the product
• Installing the plugin
Wednesday, November 3, 2010
5. Challenge #1: Starting
Product Startup method
JIRA
bin/startup.sh or .bat (standalone) or WAR install into
app. server
Confluence
bin/startup.sh or .bat (standalone) or WAR install into
app. server
Bamboo
bamboo.sh or Win32 service or WAR install into app.
server
Crowd
start_crowd.sh or .bat (standalone) or WAR install
into app. server
FishEye/Crucible run.sh or .bat – no WAR version available
Wednesday, November 3, 2010
6. Challenge #2: Config
Product Data/logs dir. Configuration
JIRA jira-home
WEB-INF/classes/jira-
application.properties
Confluence None by default
WEB-INF/classes/confluence-
init.properties
Bamboo None by default
WEB-INF/classes/bamboo-
init.properties
Crowd None by default
WEB-INF/classes/crowd-
init.properties, system / servlet
context property
FishEye/
Crucible
var FISHEYE_INST environment variable
Wednesday, November 3, 2010
7. Challenge #3: Plugin
install
Product Install methods
JIRA
Two plugin directories for different plugin
systems, web interface
Confluence
Two plugin directories for different plugin
systems, web interface, plugin repository
Bamboo
Two plugin directories for different plugin
systems, web interface
Crowd One plugin directory (plugins 2 only)
FishEye/Crucible One plugin directory (plugins 2 only)
Wednesday, November 3, 2010
8. And if that wasn’t
enough...
• Build systems
• Maven 1 or 2? Ant?
• Confusing dependencies
• Starting a plugin project
• Expert product knowledge
required just to get started
• Maven archetypes are too
hard to use
Wednesday, November 3, 2010
9. It all adds up to...
• Lots of small headaches
• Not your fault
• Not your job to fix
them
• Slow code/test/debug
cycle
• Frustration
Wednesday, November 3, 2010
10. How the SDK deals
with this
“What is happiness? The feeling that power is growing,
that resistance is overcome.”
--Friedrich Nietzsche, LISP user
Wednesday, November 3, 2010
11. Challenge #1: Starting
Product Startup method
JIRA
bin/startup.sh or .bat (standalone) or WAR install into
app. server
Confluence
bin/startup.sh or .bat (standalone) or WAR install into
app. server
Bamboo
bamboo.sh or Win32 service or WAR install into app.
server
Crowd
start_crowd.sh or .bat (standalone) or WAR install
into app. server
FishEye/Crucible run.sh or .bat – no WAR version available
Wednesday, November 3, 2010
12. Challenge #1: Starting
Product Startup method
JIRA
bin/startup.sh or .bat (standalone) or WAR install into
app. server
Confluence
bin/startup.sh or .bat (standalone) or WAR install into
app. server
Bamboo
bamboo.sh or Win32 service or WAR install into app.
server
Crowd
start_crowd.sh or .bat (standalone) or WAR install
into app. server
FishEye/Crucible run.sh or .bat – no WAR version available
atlas-run
Wednesday, November 3, 2010
13. Challenge #2: Config
Product Data/logs dir. Configuration
JIRA jira-home
WEB-INF/classes/jira-
application.properties
Confluence None by default
WEB-INF/classes/confluence-
init.properties
Bamboo None by default
WEB-INF/classes/bamboo-
init.properties
Crowd None by default
WEB-INF/classes/crowd-
init.properties, system / servlet
context property
FishEye/
Crucible
var FISHEYE_INST environment variable
Wednesday, November 3, 2010
14. Challenge #2: Config
Product Data/logs dir. Configuration
JIRA jira-home
WEB-INF/classes/jira-
application.properties
Confluence None by default
WEB-INF/classes/confluence-
init.properties
Bamboo None by default
WEB-INF/classes/bamboo-
init.properties
Crowd None by default
WEB-INF/classes/crowd-
init.properties, system / servlet
context property
FishEye/
Crucible
var FISHEYE_INST environment variable
Logs sent to console,
preconfigured data dirs
Wednesday, November 3, 2010
15. Challenge #3: Plugin
install
Product Install methods
JIRA
Two plugin directories for different plugin
systems, web interface
Confluence
Two plugin directories for different plugin
systems, web interface, plugin repository
Bamboo
Two plugin directories for different plugin
systems, web interface
Crowd One plugin directory (plugins 2 only)
FishEye/Crucible One plugin directory (plugins 2 only)
Wednesday, November 3, 2010
16. Challenge #3: Plugin
install
Product Install methods
JIRA
Two plugin directories for different plugin
systems, web interface
Confluence
Two plugin directories for different plugin
systems, web interface, plugin repository
Bamboo
Two plugin directories for different plugin
systems, web interface
Crowd One plugin directory (plugins 2 only)
FishEye/Crucible One plugin directory (plugins 2 only)
Automatic through
atlas-run
Wednesday, November 3, 2010
17. SDK Design
A process cannot be understood by stopping it.
Understanding must move with the flow of the
process, must join it and flow with it.
-- First Law of Mentat
Wednesday, November 3, 2010
18. Atlassian Maven
Plugin Suite
• Suite of Maven plugins
• maven-jira-plugin, maven-confluence-
plugin, etc.
• Common interface to products
• Handles installation and configuration
• Can be used independently of the SDK
Wednesday, November 3, 2010
19. Script shortcuts
Task Maven command Script
Start product with current
plugin installed
mvn amps:run atlas-run
Start product with current
plugin installed and
debuggable
mvn amps:debug atlas-debug
Start JIRA on port 8243 and
context “myjira” with current
plugin installed
mvn amps:run
–Dproduct=jira
–Dcontext.path=/myjira
–Dhttp.port=8243
atlas-run
--product jira
--context-path /myjira
--http-port 8243
Run arbitrary Maven
command
mvn myplugin:mygoal
<parameters>
atlas-mvn myplugin:mygoal
<parameters>
Wednesday, November 3, 2010
20. SDK in action
By pressing down a special key
It plays a little melody
--”Pocket Calculator”, Kraftwerk
Wednesday, November 3, 2010
21. SDK with Plugins 1.0
• SDK is only at full power with plugins 2
• http://confluence.atlassian.com/x/wRyyCg
for details on how
Wednesday, November 3, 2010
22. 30-second
Plugin Creation™
• Creating a plugin is dirt simple!
• atlas-create-<product>-plugin
• Executes a Maven archetype
• Automatically prompts for required
information
• Created plugin project works out of the
box
Wednesday, November 3, 2010
25. On-the-fly code change
•Fast code/test/debug
•Start a CLI instance in a
separate terminal from atlas-run
•Make a code change
•Reinstall the plugin from the CLI
Wednesday, November 3, 2010
28. Auto resource reload
• Plugin web resources
are monitored
• Detects change and
auto-updates
• Just reload the
browser, see your
changes, get the
green-skinned alien
girl, repeat
Wednesday, November 3, 2010
31. Boxed Maven
• Contains a standalone,
isolated Maven 2.1.0
• Uses Atlassian repos
by default
• No extra
configuration needed
• Usable on its own
• atlas-mvn passes
parameters and goals
straight through
Wednesday, November 3, 2010
32. What’s new
Come on! Stop trying to hit me and hit me!
--Morpheus, The Matrix
Wednesday, November 3, 2010
33. External home
directories
• Create a zip of an existing product home
directory
• atlas-run starts the product with that data/
configuration/etc.
• Thanks to Jonathan Doklovic @ SysBliss!
Wednesday, November 3, 2010
34. Test groups
• Create groups of
tests
• Write a group of
tests for all supported
products and separate
groups for product-
specific testing
• Run one, some, or all
groups at once
Wednesday, November 3, 2010
35. Multiple version testing
• Run a test (or a
test group)
against multiple
versions of the
same product
• “Why does it
work in JIRA 4.1
but not 4.2?”
Wednesday, November 3, 2010
36. Co-installs
• Your plugin may
require other
plugins or special
artifacts to run
• SDK can install
these for you
during atlas-run
or atlas-debug
Wednesday, November 3, 2010
38. Vital statistics
• The SDK is open source
• Apache License 2.0
• Frequent updates, new features and
support for new product releases
• Outside committers contributing
Wednesday, November 3, 2010
39. Helping out
• Development IS at http://studio.atlassian.com/
browse/AMPS
• ThingsYOU can help with right now:
• Documentation
• Testing on Windows
• FeaturesYOU can help with:
• Per-plugin storage
Wednesday, November 3, 2010
40. Wrap-up
• SDK makes plugin and
gadget creation easier
• Works in all products
• Faster code/test/debug cycle
• Tight integration with
Atlassian
• Flexible enough to work in
your system
Wednesday, November 3, 2010