atlascamp 2015: plugins 2: all grown up
TRANSCRIPT
Plugins 2 : All Grown Up
JAMES WINTERS • PLATFORM LORD • ATLASSIAN
ALEX COURTIS • YAK SHAVER • ATLASSIAN
N E W A N D C O O L
M AT U R E P 2
Mature P2
S D K / A M P S 6 . 0
S A L
C H E C K L I S T
F U T U R E P L U G I N S
atlassian-plugins-api
We Updated allthethings!
• Java 8 Language Support• Spring 2.5 -> 4.1• HttpClient 3.x -> 4.4• bndlib 1.43 -> 2.4
• Guava 11.0.2 -> 18.0• Spring DM 2.x -> Apache Gemini Blueprint 2.0• Velocity 1.5, 1.6 -> 1.6, 1.7• Closure Templates (aka Soy) 2011-12-22 -> 2014-04-22
Plugin Lifecycle That Works!
Better OSGi Resolution
Producer✕
Mandatory ↓Optional ↺Dynamic ↺
Better OSGi Resolution (alt)
Producer↓
Mandatory ↓Optional ↺Dynamic ¯\_(ツ)_/¯
atlassian-trusted-apps
Atlassian Connect
OAuth 2LO
@Deprecated
M AT U R E P 2
N E W A N D C O O L
New And Cool
S D K / A M P S 6 . 0
S A L
C H E C K L I S T
F U T U R E P L U G I N S
New Applications Only
JIRA 7.0 Confluence 5.9 Stash 4.0
Servlet 3.0 - Dynamic Servlet
servletContext.addServlet("my-path", myServletInstance);
servletContext.addServlet("my-path", MyServlet.class);
Dynamic Modules
final Element e = new DOMElement("servlet");e.addAttribute("key", "my-servlet");e.addAttribute("class", MyServlet.class.getName());final Element url = new DOMElement("url-pattern");url.setText("/my-path");e.add(url);pluginController.addDynamicModule(plugin, e);
atlassian-plugin.xml Fragments
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-amps-plugin</artifactId> <configuration> ... <instructions> ... <Atlassian-Scan-Folders> META-INF/plugin-descriptor, META-INF/plugin-rest-modules, ... </Atlassian-Scan-Folders> </instructions> </configuration></plugin>
Plugin Transformation
https://bitbucket.org/atlassian/atlassian-spring-scanner
M AT U R E P 2
S D K / A M P S 6 . 0
SDK / AMPS 6.0
N E W A N D C O O L
S A L
C H E C K L I S T
F U T U R E P L U G I N S
3.2 / 3.3 Only
AMPS Supports Real Databases
<dataSource> <driver>org.postgresql.Driver</driver> <url>jdbc:postgresql://localhost:5432/confdb</url> <username>conf_user</username> <password>conf_pwd</password> <defaultDatabase>jdbc:postgresql://localhost:5432/postgres</defaultDatabase> <systemUsername>postgres</systemUsername> <systemPassword>supah_secret</systemPassword>
<dumpFilePath>${project.build.directory}/classes/pg_c59.sql</dumpFilePath> <importMethod>sql</importMethod>
bndlib 2.4 - java 8 bytecode
Keep Maven and OSGi Happy
http://semver.org/
MavenThis goes in your POM’s <version><MAJOR>.<MINOR>.<MICRO>-<QUALIFIER>
OSGibndlib translates it to this in your MF<MAJOR>.<MINOR>.<MICRO>.<QUALIFIER>
YES5.8.0
5.8.0-SNAPSHOT
5.8.0-m001
NO5.8
5.8-SNAPSHOT
5.8.SNAPSHOT
5.8.m1
5.8-m1
M AT U R E P 2
S A L
SAL
N E W A N D C O O L
S D K / A M P S 6 . 0
C H E C K L I S T
F U T U R E P L U G I N S
Better Security
Some Highlights
public class HttpClientRequest{ public HttpClientRequest addAuthentication public HttpClientRequest addBasicAuthentication public HttpClientRequest addSeraphAuthentication public HttpClientRequest addTrustedTokenAuthentication
@Deprecatedpublic interface CertificateFactory
New License API
Multi Product License Support
public interface LicenseHandler{ boolean hostAllowsMultipleLicenses(); boolean hostAllowsCustomProducts(); Set<String> getProductKeys(); void addProductLicense(String productKey, String license); String getServerId(); SortedSet<String> getAllSupportEntitlementNumbers(); . . .
Trusted App Changes
LifecycleAware
M AT U R E P 2
C H E C K L I S T
Checklist
N E W A N D C O O L
S D K / A M P S 6 . 0
S A L
F U T U R E P L U G I N S
Go Easy On*;resolution:=optional
Be Compatible -
Guava 11 and 18
Update Your Tooling
atlas-create-plugin
M AT U R E P 2
F U T U R E P L U G I N S
Future Plugins
N E W A N D C O O L
S D K / A M P S 6 . 0
S A L
C H E C K L I S T
Atlassian Connect
Bare Bones OSGi
Thank you!
JAMES WINTERSPLATFORM LORD
ATLASSIAN
ALEX COURTISYAK SHAVERATLASSIAN
MARCOS SCRIVENYAK SHAVERATLASSIAN
Plugins 2: All Grown Up
Submit your feedback: go.atlassian.com/acplugins2