Skip to content

Instantly share code, notes, and snippets.

@GetMapping("/{message}")
public String helloMessage(@PathVariable String message) {
return String.format("Hello, %s!", message);
}

Extending Spring Boot for the Enterprise and Cloud Workshop

Spring Boot has become incredibly popular since it's initial release in 2013. Spring Boot allows developers in the matters of minutes or hours to build functionality that would take days or weeks to build before.

Over the same time period Cloud Platforms have grown in size and capability. Like Spring Boot Cloud platforms can deliver functionality in minutes or hours what would take many organizations days, weeks, or even months to build out and deploy.

While this "out of the box" functionality of Spring Boot and Cloud platforms is great, it can be taken further. Spring Boot and Cloud Platforms are built to address very broad domains, but individual organizations will often have a much more narrow focus. In this workshop we will see how we can extend and build on top of Spring Boot and Cloud platforms to better address the needs of our organizations.

What You Will Learn

In this workshop you will learn about the following concepts:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<properties>
<my-org.version>0.0.1-SNAPSHOT</my-org.version>
</properties>
<dependencyManagement>
<dependencies>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring.boot.version}</version>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.my.developer</groupId>
<artifactId>my-org-starter-security</artifactId>
<version>0.0.1-SNAPSHOT</version>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
@ConfigurationProperties(prefix = "my-org.web.security")
public class WebSecurityConfigurer {
/**
* Endpoints that require the USER role to access
*/
private String[] userEndpoints = new String[] {};
/**
* Endpoints that require the ADMIN role to access
*/
@ConfigurationProperties(prefix="my-org.cli.security")
public class CommandLineSecurityConfigurer {
/**
* The role a user must have to run the application.
*/
private String requiredRole;
public String getRequiredRole() {
return requiredRole;
{
"groups": [
{
"name": "my-org.cli.security",
"type": "org.my.developer.security.CommandLineSecurityConfigurer"
},
{
"name": "my-org.web.security",
"type": "org.my.developer.security.WebSecurityConfigurer"
}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>2.2.2.RELEASE</version>
<optional>true</optional>
</dependency>