June 3-5, 2014 | Berlin, Germany
A P2 Plugin and a
SaaS Platform Walk
Into a Bar…
Jonathan Doklovic, Principal Developer, Atlassian
Stuff That Came out of Developing
Atlassian Connect That Can Help
Make Writing P2 Plugins and Even
Plain Old Java Projects...
Nomenclature
P2
P2Connect
Addons
P2
P2
P2
Building Made Easy
Git Flow
Git Flow vs.
GIT Flow + Maven
K I S S YO U R S A N I T Y G O O D BY E
I want to
merge A LOT
without
conflicts!
Screw
conflicts, I
want to...
Maven JGIT Flow Plugin
• No need to install git-flow!
• No maven-release-plugin!
• Smartly manages version changes between ...
Transformers Are Evil
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-
version="2">
<plugin-info...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3...
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3...
@Named
@Inject
@JiraComponent
@ConfluenceComponent
@ClasspathComponent
@ComponentImport
@ConfluenceImport
@JiraImport
@Exp...
Atlassian Spring Scanner
• No jar transforms!
• No runtime classpath scanning!
• Moves all component related things into j...
How Do You Install
Nothing?
P2 ==
Dynamic Plugin Modules
bitbucket.org/atlassian/atlassian-pocketknife
• Modules are registered as OSGi Services!
• Complete...
Live, Breathe and Eat Code;
Spit Out Docs
XSD
XSD
+
json-schema Generator
• Generate json-schema from JAVA POJOs!
• Easy to use annotations!
• Schema can be validated with AN...
json-schema + Maven
• Generate json-schema from JAVA POJOs!
• Easy to use annotations!
• Schema can be validated with ANY ...
json-schemagen
bitbucket.org/atlassian/json-schemagen
• json-schema from JAVA POJO’s!
• Runs as a Maven plugin!
• Javadocs...
bitbucket.org/atlassian/jgit-flow
bitbucket.org/atlassian/atlassian-spring-scanner
bitbucket.org/atlassian/json-schemagen
...
Get In Touch
Here At AtlasCamp
doklovic@atlassian.com
@sysbliss
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar
Upcoming SlideShare
Loading in …5
×

AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar

1,117 views

Published on

In order to build Atlassian Connect, we had to work around all the legacy code and architecture that made it impossible to scale P2 plugins in our hosted OnDemand platform in the first place. Learn how the Connect team jumped through flaming hoops, juggled sharp objects, and used non-existent technology not only to build Atlassian Connect, but new also tools and techniques useful to any plugin developer.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,117
On SlideShare
0
From Embeds
0
Number of Embeds
363
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

AtlasCamp 2014: A P2 Plugin and a SaaS Platform Walk Into a Bar

  1. 1. June 3-5, 2014 | Berlin, Germany
  2. 2. A P2 Plugin and a SaaS Platform Walk Into a Bar… Jonathan Doklovic, Principal Developer, Atlassian
  3. 3. Stuff That Came out of Developing Atlassian Connect That Can Help Make Writing P2 Plugins and Even Plain Old Java Projects Easier And More Efficient Jonathan Doklovic, Principal Developer, Atlassian
  4. 4. Nomenclature
  5. 5. P2
  6. 6. P2Connect Addons
  7. 7. P2
  8. 8. P2
  9. 9. P2
  10. 10. Building Made Easy
  11. 11. Git Flow
  12. 12. Git Flow vs.
  13. 13. GIT Flow + Maven K I S S YO U R S A N I T Y G O O D BY E I want to merge A LOT without conflicts! Screw conflicts, I want to change poms ! A LOT! I want SNAPSHOTS! I 
 want to add files to your working folder I want to assume you only have one master branch and commit to source control myself!
  14. 14. Maven JGIT Flow Plugin • No need to install git-flow! • No maven-release-plugin! • Smartly manages version changes between branches! • Full GIT Flow lifecycle / merge strategy! • Extra “goodies” for dealing with CI K I S S T H E M AV E N R E L E A S E P L U G I N G O O D BY E bitbucket.org/atlassian/jgit-flow
  15. 15. Transformers Are Evil
  16. 16. <atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins- version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}" /> ! <bundle-instructions> <Export-Package> com.atlassian.upm.api.util*;version="${upm.version}" </Export-Package> </bundle-instructions> </plugin-info> ! <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" /> ! <component key="someComponent" class="com.atlassian.example.SomeComponentClass" /> ! </atlassian-plugin> atlassian-plugin.xml
  17. 17. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="org.example"/> </beans>
  18. 18. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="org.example"/> </beans> @Component @Autowired
  19. 19. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <atlassian-scanner:scan-indexes/> </beans>
  20. 20. @Named @Inject @JiraComponent @ConfluenceComponent @ClasspathComponent @ComponentImport @ConfluenceImport @JiraImport @ExportAsService @ExportAsDevService
  21. 21. Atlassian Spring Scanner • No jar transforms! • No runtime classpath scanning! • Moves all component related things into java! • Makes OSGi BND actually work! • Compile time scanning == super fast plugin loads K I S S T R A N S F O R M S A N D C L A S S PAT H S C A N N I N G G O O D BY E bitbucket.org/atlassian/atlassian-spring-scanner
  22. 22. How Do You Install Nothing?
  23. 23. P2 ==
  24. 24. Dynamic Plugin Modules bitbucket.org/atlassian/atlassian-pocketknife • Modules are registered as OSGi Services! • Complete control over module lifecycle! • Super fast startup! • No longer confined to what’s in atlassian-plugin.xml! M AG I C A L M O D U L E S A P P E A R A N D D I S A P P E A R
  25. 25. Live, Breathe and Eat Code; Spit Out Docs
  26. 26. XSD
  27. 27. XSD
  28. 28. +
  29. 29. json-schema Generator • Generate json-schema from JAVA POJOs! • Easy to use annotations! • Schema can be validated with ANY json-schema validator! • Plain Ol’ JAVA library can be embedded in anything
  30. 30. json-schema + Maven • Generate json-schema from JAVA POJOs! • Easy to use annotations! • Schema can be validated with ANY json-schema validator! • Now embedded in a Maven plugin! • Adds javadocs as schema descriptions! • Compile time generation
  31. 31. json-schemagen bitbucket.org/atlassian/json-schemagen • json-schema from JAVA POJO’s! • Runs as a Maven plugin! • Javadocs included in schema! • Easily generate example code! • Keep you docs in your DVCS! • Never let your docs get out of date! W R I T E C O D E N O T D O C S
  32. 32. bitbucket.org/atlassian/jgit-flow bitbucket.org/atlassian/atlassian-spring-scanner bitbucket.org/atlassian/json-schemagen bitbucket.org/atlassian/atlassian-pocketknife Resources
  33. 33. Get In Touch Here At AtlasCamp doklovic@atlassian.com @sysbliss

×