As Atlassian Connect is the way forward for building add-ons on Atlassian Cloud, Spring Boot is the way forward for building Spring web applications. Now you can combine the best of both worlds with the new open source library: Atlassian Connect Starter for Spring Boot. This will get you bootstrapped with an Atlassian Connect add-on in just a few minutes. In this talk you will learn:
What is Spring Boot
What is a Spring Boot Starter and how they benefit you
How to use the Atlassian Connect Starter to easily build Atlassian Connect add-ons
The Atlassian Connect architecture and how it interacts with your add-ons
We will write a simple macro for Confluence and show how much time Spring Boot can save you.
7. A “vanilla” Spring web app
1. Dependencies
Setup the right Maven dependencies
8. A “vanilla” Spring web app
1. Dependencies
Setup the right Maven dependencies
web.xml
Setup your web.xml
9. A “vanilla” Spring web app
1. Dependencies
Setup the right Maven dependencies
application-context.xml
Enable component scanning and mvc
annotation driven
web.xml
Setup your web.xml
10. A “vanilla” Spring web app
1. Dependencies
Setup the right Maven dependencies
4. The actual controller
What you actually care about
application-context.xml
Enable component scanning and mvc
annotation driven
web.xml
Setup your web.xml
11. A “vanilla” Spring web app
5. Install Tomcat
And configure it as well
1. Dependencies
Setup the right Maven dependencies
4. The actual controller
What you actually care about
application-context.xml
Enable component scanning and mvc
annotation driven
web.xml
Setup your web.xml
12. A “vanilla” Spring web app
5. Install Tomcat
And configure it as well
6. It might work
You probably made a typo
1. Dependencies
Setup the right Maven dependencies
4. The actual controller
What you actually care about
application-context.xml
Enable component scanning and mvc
annotation driven
web.xml
Setup your web.xml
13. • Big cool statistic
• 2,56
9
• Add-Ons in Marketplace
Repeatable pattern
https://flic.kr/p/8ykpkW
18. Example: Hello world
e
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class HelloApplication {
public static void main(String[] args) {
SpringApplication.run(HelloApplication.class, args);
}
}
19. Example: Hello world
e
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class HelloApplication {
public static void main(String[] args) {
SpringApplication.run(HelloApplication.class, args);
}
}
@SpringBootApplication
public class HelloApplication {
20. Example: Hello world
e
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication
public class HelloApplication {
public static void main(String[] args) {
SpringApplication.run(HelloApplication.class, args);
}
}
public static void main(String[] args) {
SpringApplication.run(HelloApplication.class, args);
}
21. Example: Hello world
e
package hello;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
}
22. Example: Hello world
e
package hello;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
}
@RestController
public class HelloController {
23. Example: Hello world
e
package hello;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
}
@RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
74. Create the application
e
package com.atlassian.connect.atlascamp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class InceptionApplication {
public static void main( String[] args ) {
SpringApplication.run(InceptionApplication.class, args);
}
}
75. Create the application
e
package com.atlassian.connect.atlascamp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class InceptionApplication {
public static void main( String[] args ) {
SpringApplication.run(InceptionApplication.class, args);
}
}
@SpringBootApplication
public class InceptionApplication {
76. Create the application
e
package com.atlassian.connect.atlascamp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class InceptionApplication {
public static void main( String[] args ) {
SpringApplication.run(InceptionApplication.class, args);
}
}
public static void main(String[] args) {
SpringApplication.run(InceptionApplication.class, args);
}