Building and deploying Spring Boot applications

You can build your Spring Boot applications for use in CICS with Maven or with Gradle.

Building Spring Boot applications as WAR files

You can build Spring Boot applications as a web application archive (WAR), which allows you to integrate Spring Framework transactional management or Spring Boot Security in CICS. See Table 1. When built as a WAR, a Spring Boot application can be deployed and managed by using CICS bundles in the same way as other CICS Liberty applications.

Note: Only Spring Boot applications built as WAR files are supported in CICS TS 5.3 and 5.4. JAR files are supported from CICS TS 5.5.

The following diagram displays the different options that you can take to run your Spring Boot application on CICS.

The different options that you can take to run your Spring Boot application on CICS.
Before building, you must set the packaging type of your Spring Boot application as a deployable WAR. Your main application class must extend the SpringBootServletInitializer and override the configure method. You must also declare the Spring Boot embedded web container (typically Tomcat) as a provided dependency in your build script so that it can be replaced with Liberty's web-container at run time.
@SpringBootApplication
public class MyApplication extends SpringBootServletInitializer 
{
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) 
    {
        return application.sources(MyApplication.class);
    }

    public static void main(String[] args) 
    {
        SpringApplication.run(MyApplication.class, args);
    }
}

For detailed information about creating a deployable WAR file with Maven or Gradle, see Create a deployable WAR file in the Spring Boot documentation.

For more information about building applications with Maven and Gradle, see Developing applications using Maven or Gradle