Spring boot compatibility

An Across application runs as a Spring Boot application but deviates from regular Spring Boot applications in several aspects.

See also the Across Application Descriptor for some background information.

ApplicationContext hierarchy

An Across application is made up of several Across modules. Every module is its own Spring ApplicationContext with the Across Application Descriptor providing a shared parent ApplicationContext.

This is different from most regular Spring Boot applications that only define a single ApplicationContext holding all components. Across encourages you to bundle components as much as possible in separate modules.

Auto-configuration support

An Across application must use @AcrossApplication instead of @SpringBootApplication. Using regular @EnableAutoConfiguration and top-level @ComponentScan is not supported.

Auto-configuration is attempted by default when using @AcrossApplication.

Spring Boot starters

Spring Boot starter configurations must be adapted to work in a multi-module Across application.

The separate across-autoconfigure project provides Across support for many standard starters and commonly used frameworks. See the separate document on Auto-configuration support for an overview of the supported starters, as well as more information on how to make libraries compatible with Across.

Excluding auto-configuration classes

You can forcibly exclude auto-configuration classes from being loaded by adding them to the application descriptor.

Excluding auto-configuration classes
@AcrossApplication(excludeAutoConfigurations = { AopAutoConfiguration.class })
public class SampleApplication
{
}

Disabling auto-configuration

If you want to disable Across auto-configuration altogether, you can do using the autoConfiguration attribute.

Disabling auto-configuration support
@AcrossApplication(modules = AcrossWebModule.NAME, autoConfiguration = false)
public class SampleApplication
{
}