public class FabricSpringApplication extends Object
Executable Java class to be used as a base for the Fabric-managed Spring Boot applications. Its main purpose is to eliminate the custom code bootstrapping the application, so end-users could create Spring Boot managed process via Fabric without any custom wiring.
FabricSpringApplication
can be used in the conjunction with the Fabric Jar Managed Process installer (just
as demonstrated on the snippet below).
process:install-jar -m io.fabric8.process.spring.boot.container.FabricSpringApplication my.group.id my-artifact 1.0
Keep in mind that you don't have to use FabricSpringApplication
in order to use Fabric goodies for Spring
Boot (like Fabric starters). However we recommend to use this class as an entry point for your Fabric SpringBoot
integration, as it implements our opinionated view of the proper Fabric+Boot wiring.
In order to specify packages that should be scanned for additional @Component
and @Configuration
classes, use
standard Spring Boot spring.main.sources
system property. For example if your project @Configuration
classes are located in
the com.example.project
package, you can use the following command to install your jar as a managed process:
process:install-jar -m io.fabric8.process.spring.boot.container.FabricSpringApplication --jvm-options=-Dspring.main.sources=com.example.project my.group.id my-artifact 1.0
Modifier and Type | Field and Description |
---|---|
static String[] |
NO_ARGUMENTS |
static String |
SPRING_MAIN_SOURCES |
static String |
WEB_PROPERTY_KEY |
Constructor and Description |
---|
FabricSpringApplication() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
FabricSpringApplication |
parent(org.springframework.context.ConfigurableApplicationContext parent) |
protected void |
resolveWebEnvironment(org.springframework.boot.builder.SpringApplicationBuilder applicationBuilder) |
org.springframework.context.ConfigurableApplicationContext |
run(String... args) |
FabricSpringApplication |
web(boolean web) |
public static final String SPRING_MAIN_SOURCES
public static final String WEB_PROPERTY_KEY
public static final String[] NO_ARGUMENTS
public org.springframework.context.ConfigurableApplicationContext run(String... args)
public static void main(String[] args)
protected void resolveWebEnvironment(org.springframework.boot.builder.SpringApplicationBuilder applicationBuilder)
public FabricSpringApplication parent(org.springframework.context.ConfigurableApplicationContext parent)
public FabricSpringApplication web(boolean web)
Copyright © 2011–2014 Red Hat. All rights reserved.