Use the following commands to build run the application:
$ mvn clean package
$ mvn spring-boot:run
This example adds auto-configuration to show how the process generally works. The
src/main/resources/META-ING/spring.factories
contains a single entry which points
to LogTomcatVersionAutoConfiguration
. This class simply logs the current version
of Tomcat.
There are a couple of @Conditions
on LogTomcatVersionAutoConfiguration
which affect
when it is used. The @ConditionalOnClass
annotation makes sure that Tomcat has been
declared as a dependency. The @ConditionalOnProperty
annotation shows how you can
check that a property has a specific value.
You can change the application.properties
file or the pom.xml
file if you want to test
the conditions.