停用SpringBoot的自动配置的方法
总而言之
在这篇文章中,我们将介绍如何在使用Spring Boot时禁用自动配置功能,它能够自动执行各种设置。
Spring Boot的自动配置是一项非常方便的功能,当开发者没有有意定义Bean时,它会自动定义和启用所需的Bean。但在开发过程中等情况下,可能会有一些情况下我们想暂时停用这个功能。
因此,尽管平时并不需要此方法,但作为参考,我将将其列入条目。
目标读者
-
- SpringBootで基本的なアプリケーションを動作させられる方
- SpringBootのAuto-configure周りについて知りたい方
前提 tí)
- 2018年5月時点のSpringBoot(1.5.x系)
参考的网站 de
初生之犊
本家网站上已经详细说明了有关自动配置的概述和控制方法。如果读者已经理解了这些内容,就无需再继续阅读这篇文章了。
– 参考网站[1] 16. 自动配置
在Qiita的平台上
对于自动配置的机制进行了详细说明。本文将实际尝试文章末尾部分的禁用部分。参考网站[2]理解Spring Boot的自动配置机制。
無效化的方法
将所有事物失效的方法
请参照[2]中的网站,下列内容为指定内容。
spring:
boot:
enableautoconfiguration: false
使用类别指定进行失效的方法
正如[2]网站上所述,SpringBoot的自动配置通过按照指定规则逐行扫描在”spring.factories”文件中定义的Configuration类来实现。例如,在SpringBoot的1.5.x系列中,适用的是在第18行以下的” # Auto Configure”注释后指定的配置。
我已准备好使用这个来在Spring Boot的application.yml文件中禁用的例子。
这是在示例源代码中的application.yml文件。
如果将相关部分剪切出来,将会如下所示。
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration,org.springframework.boot.autoconfigure.aop.AopAutoConfiguration,org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration,org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration,org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration,org.springframework.boot.autoconfigure.cloud.CloudAutoConfiguration,org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration,org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration,org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration,org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration,org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration,org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration,org.springframework.boot.autoconfigure.data.cassandra.CassandraRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration,org.springframework.boot.autoconfigure.data.couchbase.CouchbaseRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration,org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration,org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.ldap.LdapDataAutoConfiguration,org.springframework.boot.autoconfigure.data.ldap.LdapRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration,org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.neo4j.Neo4jDataAutoConfiguration,org.springframework.boot.autoconfigure.data.neo4j.Neo4jRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration,org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration,org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration,org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration,org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration,org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration,org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration,org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration,org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration,org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration,org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration,org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration,org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration,org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration,org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration,org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration,org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration,org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration,org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration,org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration,org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration,org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration,org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration,org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration,org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration,org.springframework.boot.autoconfigure.mail.MailSenderValidatorAutoConfiguration,org.springframework.boot.autoconfigure.mobile.DeviceResolverAutoConfiguration,org.springframework.boot.autoconfigure.mobile.DeviceDelegatingViewResolverAutoConfiguration,org.springframework.boot.autoconfigure.mobile.SitePreferenceAutoConfiguration,org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration,org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration,org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration,org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration,org.springframework.boot.autoconfigure.security.SecurityFilterAutoConfiguration,org.springframework.boot.autoconfigure.security.FallbackWebSecurityAutoConfiguration,org.springframework.boot.autoconfigure.security.oauth2.OAuth2AutoConfiguration,org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration,org.springframework.boot.autoconfigure.session.SessionAutoConfiguration,org.springframework.boot.autoconfigure.social.SocialWebAutoConfiguration,org.springframework.boot.autoconfigure.social.FacebookAutoConfiguration,org.springframework.boot.autoconfigure.social.LinkedInAutoConfiguration,org.springframework.boot.autoconfigure.social.TwitterAutoConfiguration,org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration,org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration,org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration,org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration,org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration,org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration,org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration,org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration,org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration,org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration,org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration,org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration,org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration,org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration,org.springframework.boot.autoconfigure.websocket.WebSocketMessagingAutoConfiguration,org.springframework.boot.autoconfigure.webservices.WebServicesAutoConfiguration
查看Spring Boot启动时的日志,可以通过以下指定来确定是否存在如下两种情况。
AUTO-CONFIGURATION REPORT
=========================
Positive matches:
—————–
DataSourceTransactionManagerAutoConfiguration matched:
– @ConditionalOnClass found required classes ‘org.springframework.jdbc.core.JdbcTemplate’, ‘org.springframework.transaction.PlatformTransactionManager’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
DataSourceTransactionManagerAutoConfiguration.DataSourceTransactionManagerConfiguration matched:
– @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans ‘datasource1’, ‘datasource2’ (OnBeanCondition)
GenericCacheConfiguration matched:
– Cache org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration automatic cache type (CacheCondition)
JdbcTemplateAutoConfiguration matched:
– @ConditionalOnClass found required classes ‘javax.sql.DataSource’, ‘org.springframework.jdbc.core.JdbcTemplate’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
– @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans ‘datasource1’, ‘datasource2’ (OnBeanCondition)
JdbcTemplateAutoConfiguration#jdbcTemplate matched:
– @ConditionalOnMissingBean (types: org.springframework.jdbc.core.JdbcOperations; SearchStrategy: all) did not find any beans (OnBeanCondition)
JdbcTemplateAutoConfiguration#namedParameterJdbcTemplate matched:
– @ConditionalOnMissingBean (types: org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations; SearchStrategy: all) did not find any beans (OnBeanCondition)
JmxAutoConfiguration matched:
– @ConditionalOnClass found required class ‘org.springframework.jmx.export.MBeanExporter’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
– @ConditionalOnProperty (spring.jmx.enabled=true) matched (OnPropertyCondition)
JmxAutoConfiguration#mbeanExporter matched:
– @ConditionalOnMissingBean (types: org.springframework.jmx.export.MBeanExporter; SearchStrategy: current) did not find any beans (OnBeanCondition)
JmxAutoConfiguration#mbeanServer matched:
– @ConditionalOnMissingBean (types: javax.management.MBeanServer; SearchStrategy: all) did not find any beans (OnBeanCondition)
JmxAutoConfiguration#objectNamingStrategy matched:
– @ConditionalOnMissingBean (types: org.springframework.jmx.export.naming.ObjectNamingStrategy; SearchStrategy: current) did not find any beans (OnBeanCondition)
MybatisAutoConfiguration matched:
– @ConditionalOnClass found required classes ‘org.apache.ibatis.session.SqlSessionFactory’, ‘org.mybatis.spring.SqlSessionFactoryBean’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
– @ConditionalOnBean (types: javax.sql.DataSource; SearchStrategy: all) found beans ‘datasource1’, ‘datasource2’ (OnBeanCondition)
MybatisAutoConfiguration#sqlSessionTemplate matched:
– @ConditionalOnMissingBean (types: org.mybatis.spring.SqlSessionTemplate; SearchStrategy: all) did not find any beans (OnBeanCondition)
NoOpCacheConfiguration matched:
– Cache org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration automatic cache type (CacheCondition)
PersistenceExceptionTranslationAutoConfiguration matched:
– @ConditionalOnClass found required class ‘org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
PersistenceExceptionTranslationAutoConfiguration#persistenceExceptionTranslationPostProcessor matched:
– @ConditionalOnProperty (spring.dao.exceptiontranslation.enabled) matched (OnPropertyCondition)
– @ConditionalOnMissingBean (types: org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; SearchStrategy: all) did not find any beans (OnBeanCondition)
PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:
– @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)
RedisCacheConfiguration matched:
– Cache org.springframework.boot.autoconfigure.cache.RedisCacheConfiguration automatic cache type (CacheCondition)
SimpleCacheConfiguration matched:
– Cache org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration automatic cache type (CacheCondition)
TransactionAutoConfiguration matched:
– @ConditionalOnClass found required class ‘org.springframework.transaction.PlatformTransactionManager’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
TransactionAutoConfiguration#platformTransactionManagerCustomizers matched:
– @ConditionalOnMissingBean (types: org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; SearchStrategy: all) did not find any beans (OnBeanCondition)
TransactionAutoConfiguration.TransactionTemplateConfiguration matched:
– @ConditionalOnSingleCandidate (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) found a primary bean from beans ‘txManager1’, ‘txManager2’ (OnBeanCondition)
TransactionAutoConfiguration.TransactionTemplateConfiguration#transactionTemplate matched:
– @ConditionalOnMissingBean (types: org.springframework.transaction.support.TransactionTemplate; SearchStrategy: all) did not find any beans (OnBeanCondition)
Negative matches:
—————–
ActiveMQAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.jms.ConnectionFactory’, ‘org.apache.activemq.ActiveMQConnectionFactory’ (OnClassCondition)
AopAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.aspectj.lang.annotation.Aspect’, ‘org.aspectj.lang.reflect.Advice’ (OnClassCondition)
ArtemisAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.jms.ConnectionFactory’, ‘org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory’ (OnClassCondition)
BatchAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.batch.core.launch.JobLauncher’ (OnClassCondition)
CacheAutoConfiguration:
Did not match:
– @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) did not find any beans (OnBeanCondition)
Matched:
– @ConditionalOnClass found required class ‘org.springframework.cache.CacheManager’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
CacheAutoConfiguration.CacheManagerJpaDependencyConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean’ (OnClassCondition)
– Ancestor org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
CaffeineCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.github.benmanes.caffeine.cache.Caffeine’, ‘org.springframework.cache.caffeine.CaffeineCacheManager’ (OnClassCondition)
CassandraAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.datastax.driver.core.Cluster’ (OnClassCondition)
CassandraDataAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.datastax.driver.core.Cluster’, ‘org.springframework.data.cassandra.core.CassandraAdminOperations’ (OnClassCondition)
CassandraRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.datastax.driver.core.Session’, ‘org.springframework.data.cassandra.repository.CassandraRepository’ (OnClassCondition)
CloudAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.cloud.config.java.CloudScanConfiguration’ (OnClassCondition)
CouchbaseAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.couchbase.client.java.CouchbaseBucket’, ‘com.couchbase.client.java.Cluster’ (OnClassCondition)
CouchbaseCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.couchbase.client.java.Bucket’, ‘com.couchbase.client.spring.cache.CouchbaseCacheManager’ (OnClassCondition)
CouchbaseDataAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.couchbase.client.java.Bucket’, ‘org.springframework.data.couchbase.repository.CouchbaseRepository’ (OnClassCondition)
CouchbaseRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.couchbase.client.java.Bucket’, ‘org.springframework.data.couchbase.repository.CouchbaseRepository’ (OnClassCondition)
DataSourceTransactionManagerAutoConfiguration.DataSourceTransactionManagerConfiguration#transactionManager:
Did not match:
– @ConditionalOnMissingBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) found beans ‘txManager1’, ‘txManager2’ (OnBeanCondition)
DeviceDelegatingViewResolverAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.mobile.device.view.LiteDeviceDelegatingViewResolver’ (OnClassCondition)
DeviceResolverAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.mobile.device.DeviceResolverHandlerInterceptor’, ‘org.springframework.mobile.device.DeviceHandlerMethodArgumentResolver’ (OnClassCondition)
DispatcherServletAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.web.servlet.DispatcherServlet’ (OnClassCondition)
EhCacheCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘net.sf.ehcache.Cache’, ‘org.springframework.cache.ehcache.EhCacheCacheManager’ (OnClassCondition)
ElasticsearchAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.elasticsearch.client.Client’, ‘org.springframework.data.elasticsearch.client.TransportClientFactoryBean’, ‘org.springframework.data.elasticsearch.client.NodeClientFactoryBean’ (OnClassCondition)
ElasticsearchDataAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.elasticsearch.client.Client’, ‘org.springframework.data.elasticsearch.core.ElasticsearchTemplate’ (OnClassCondition)
ElasticsearchRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.elasticsearch.client.Client’, ‘org.springframework.data.elasticsearch.repository.ElasticsearchRepository’ (OnClassCondition)
EmbeddedLdapAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.unboundid.ldap.listener.InMemoryDirectoryServer’ (OnClassCondition)
EmbeddedMongoAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.mongodb.MongoClient’, ‘de.flapdoodle.embed.mongo.MongodStarter’ (OnClassCondition)
EmbeddedServletContainerAutoConfiguration:
Did not match:
– @ConditionalOnWebApplication (required) did not find web application classes (OnWebApplicationCondition)
ErrorMvcAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.servlet.Servlet’, ‘org.springframework.web.servlet.DispatcherServlet’ (OnClassCondition)
FacebookAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.social.config.annotation.SocialConfigurerAdapter’, ‘org.springframework.social.facebook.connect.FacebookConnectionFactory’ (OnClassCondition)
FallbackWebSecurityAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.security.config.annotation.web.configuration.EnableWebSecurity’ (OnClassCondition)
FlywayAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.flywaydb.core.Flyway’ (OnClassCondition)
FreeMarkerAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘freemarker.template.Configuration’, ‘org.springframework.ui.freemarker.FreeMarkerConfigurationFactory’ (OnClassCondition)
GroovyTemplateAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘groovy.text.markup.MarkupTemplateEngine’ (OnClassCondition)
GsonAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.google.gson.Gson’ (OnClassCondition)
GuavaCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.google.common.cache.CacheBuilder’, ‘org.springframework.cache.guava.GuavaCacheManager’ (OnClassCondition)
H2ConsoleAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.h2.server.web.WebServlet’ (OnClassCondition)
HazelcastAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.hazelcast.core.HazelcastInstance’ (OnClassCondition)
HazelcastCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.hazelcast.core.HazelcastInstance’, ‘com.hazelcast.spring.cache.HazelcastCacheManager’ (OnClassCondition)
HazelcastJpaDependencyAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.hazelcast.core.HazelcastInstance’, ‘org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean’ (OnClassCondition)
HibernateJpaAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean’, ‘javax.persistence.EntityManager’ (OnClassCondition)
HttpEncodingAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.web.filter.CharacterEncodingFilter’ (OnClassCondition)
HttpMessageConvertersAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.http.converter.HttpMessageConverter’ (OnClassCondition)
HypermediaAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.hateoas.Resource’, ‘org.springframework.web.bind.annotation.RequestMapping’, ‘org.springframework.plugin.core.Plugin’ (OnClassCondition)
InfinispanCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.infinispan.spring.provider.SpringEmbeddedCacheManager’ (OnClassCondition)
IntegrationAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.integration.config.EnableIntegration’ (OnClassCondition)
JCacheCacheConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.cache.Caching’, ‘org.springframework.cache.jcache.JCacheCacheManager’ (OnClassCondition)
JacksonAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.fasterxml.jackson.databind.ObjectMapper’ (OnClassCondition)
JerseyAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.glassfish.jersey.server.spring.SpringComponentProvider’, ‘javax.servlet.ServletRegistration’ (OnClassCondition)
JestAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘io.searchbox.client.JestClient’ (OnClassCondition)
JmsAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.jms.Message’, ‘org.springframework.jms.core.JmsTemplate’ (OnClassCondition)
JndiConnectionFactoryAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.jms.core.JmsTemplate’ (OnClassCondition)
JndiDataSourceAutoConfiguration:
Did not match:
– @ConditionalOnProperty (spring.datasource.jndi-name) did not find property ‘jndi-name’ (OnPropertyCondition)
Matched:
– @ConditionalOnClass found required classes ‘javax.sql.DataSource’, ‘org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType’; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
JooqAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.jooq.DSLContext’ (OnClassCondition)
JpaRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.data.jpa.repository.JpaRepository’ (OnClassCondition)
JtaAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘javax.transaction.Transaction’ (OnClassCondition)
KafkaAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.kafka.core.KafkaTemplate’ (OnClassCondition)
LdapAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.ldap.core.ContextSource’ (OnClassCondition)
LdapDataAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.data.ldap.repository.LdapRepository’ (OnClassCondition)
LdapRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.data.ldap.repository.LdapRepository’ (OnClassCondition)
LinkedInAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.social.config.annotation.SocialConfigurerAdapter’, ‘org.springframework.social.linkedin.connect.LinkedInConnectionFactory’ (OnClassCondition)
LiquibaseAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘liquibase.integration.spring.SpringLiquibase’ (OnClassCondition)
MailSenderAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘javax.mail.internet.MimeMessage’ (OnClassCondition)
MailSenderValidatorAutoConfiguration:
Did not match:
– @ConditionalOnProperty (spring.mail.test-connection) did not find property ‘test-connection’ (OnPropertyCondition)
MessageSourceAutoConfiguration:
Did not match:
– ResourceBundle did not find bundle with basename messages (MessageSourceAutoConfiguration.ResourceBundleCondition)
MongoAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.mongodb.MongoClient’ (OnClassCondition)
MongoDataAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.mongodb.MongoClient’, ‘org.springframework.data.mongodb.core.MongoTemplate’ (OnClassCondition)
MongoRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘com.mongodb.MongoClient’, ‘org.springframework.data.mongodb.repository.MongoRepository’ (OnClassCondition)
MultipartAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.servlet.Servlet’, ‘org.springframework.web.multipart.support.StandardServletMultipartResolver’, ‘javax.servlet.MultipartConfigElement’ (OnClassCondition)
MustacheAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.samskivert.mustache.Mustache’ (OnClassCondition)
MybatisAutoConfiguration#sqlSessionFactory:
Did not match:
– @ConditionalOnMissingBean (types: org.apache.ibatis.session.SqlSessionFactory; SearchStrategy: all) found beans ‘sqlSessionFactory2’, ‘sqlSessionFactory1’ (OnBeanCondition)
MybatisAutoConfiguration.MapperScannerRegistrarNotFoundConfiguration:
Did not match:
– @ConditionalOnMissingBean (types: org.mybatis.spring.mapper.MapperFactoryBean; SearchStrategy: all) found beans ‘&todoMapper1’, ‘&todoMapper2’ (OnBeanCondition)
Neo4jDataAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.neo4j.ogm.session.SessionFactory’, ‘org.springframework.data.neo4j.transaction.Neo4jTransactionManager’ (OnClassCondition)
Neo4jRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.neo4j.ogm.session.Neo4jSession’, ‘org.springframework.data.neo4j.repository.GraphRepository’ (OnClassCondition)
OAuth2AutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.security.oauth2.common.OAuth2AccessToken’, ‘org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter’ (OnClassCondition)
ProjectInfoAutoConfiguration#buildProperties:
Did not match:
– @ConditionalOnResource did not find resource ‘${spring.info.build.location:classpath:META-INF/build-info.properties}’ (OnResourceCondition)
ProjectInfoAutoConfiguration#gitProperties:
Did not match:
– GitResource did not find git info at classpath:git.properties (ProjectInfoAutoConfiguration.GitResourceAvailableCondition)
RabbitAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.amqp.rabbit.core.RabbitTemplate’, ‘com.rabbitmq.client.Channel’ (OnClassCondition)
ReactorAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘reactor.spring.context.config.EnableReactor’, ‘reactor.Environment’ (OnClassCondition)
RedisAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.data.redis.connection.jedis.JedisConnection’, ‘org.springframework.data.redis.core.RedisOperations’, ‘redis.clients.jedis.Jedis’ (OnClassCondition)
RedisRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘redis.clients.jedis.Jedis’, ‘org.springframework.data.redis.repository.configuration.EnableRedisRepositories’ (OnClassCondition)
RepositoryRestMvcAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration’ (OnClassCondition)
SecurityAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.security.authentication.AuthenticationManager’, ‘org.springframework.security.config.annotation.authentication.configurers.GlobalAuthenticationConfigurerAdapter’ (OnClassCondition)
SecurityFilterAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer’, ‘org.springframework.security.config.http.SessionCreationPolicy’ (OnClassCondition)
SendGridAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘com.sendgrid.SendGrid’ (OnClassCondition)
ServerPropertiesAutoConfiguration:
Did not match:
– @ConditionalOnWebApplication (required) did not find web application classes (OnWebApplicationCondition)
SessionAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.session.Session’ (OnClassCondition)
SitePreferenceAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.mobile.device.site.SitePreferenceHandlerInterceptor’, ‘org.springframework.mobile.device.site.SitePreferenceHandlerMethodArgumentResolver’ (OnClassCondition)
SocialWebAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.social.connect.web.ConnectController’, ‘org.springframework.social.config.annotation.SocialConfigurerAdapter’ (OnClassCondition)
SolrAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.apache.solr.client.solrj.impl.HttpSolrClient’, ‘org.apache.solr.client.solrj.impl.CloudSolrClient’ (OnClassCondition)
SolrRepositoriesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.apache.solr.client.solrj.SolrClient’, ‘org.springframework.data.solr.repository.SolrRepository’ (OnClassCondition)
SpringApplicationAdminJmxAutoConfiguration:
Did not match:
– @ConditionalOnProperty (spring.application.admin.enabled=true) did not find property ‘enabled’ (OnPropertyCondition)
SpringDataWebAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.data.web.PageableHandlerMethodArgumentResolver’, ‘org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter’ (OnClassCondition)
ThymeleafAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.thymeleaf.spring4.SpringTemplateEngine’ (OnClassCondition)
TransactionAutoConfiguration.EnableTransactionManagementConfiguration:
Did not match:
– @ConditionalOnMissingBean (types: org.springframework.transaction.annotation.AbstractTransactionManagementConfiguration; SearchStrategy: all) found bean ‘org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration’ (OnBeanCondition)
TransactionAutoConfiguration.EnableTransactionManagementConfiguration.CglibAutoProxyConfiguration:
Did not match:
– Ancestor org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
Matched:
– @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)
TransactionAutoConfiguration.EnableTransactionManagementConfiguration.JdkDynamicAutoProxyConfiguration:
Did not match:
– @ConditionalOnProperty (spring.aop.proxy-target-class=false) did not find property ‘proxy-target-class’ (OnPropertyCondition)
– Ancestor org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration did not match (ConditionEvaluationReport.AncestorsMatchedCondition)
TwitterAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘org.springframework.social.config.annotation.SocialConfigurerAdapter’, ‘org.springframework.social.twitter.connect.TwitterConnectionFactory’ (OnClassCondition)
ValidationAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘javax.validation.executable.ExecutableValidator’ (OnClassCondition)
WebClientAutoConfiguration.RestTemplateConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.web.client.RestTemplate’ (OnClassCondition)
WebMvcAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.servlet.Servlet’, ‘org.springframework.web.servlet.DispatcherServlet’, ‘org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter’ (OnClassCondition)
WebServicesAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.ws.transport.http.MessageDispatcherServlet’ (OnClassCondition)
WebSocketAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required classes ‘javax.servlet.Servlet’, ‘javax.websocket.server.ServerContainer’ (OnClassCondition)
WebSocketMessagingAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer’ (OnClassCondition)
XADataSourceAutoConfiguration:
Did not match:
– @ConditionalOnClass did not find required class ‘javax.transaction.TransactionManager’ (OnClassCondition)
Exclusions:
———–
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
Unconditional classes:
———————-
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
自动配置报告
=========================正匹配项:
—————–
确定匹配MybatisAutoConfiguration:
– @ConditionalOnClass找到所需类”org.apache.ibatis.session.SqlSessionFactory”、”org.mybatis.spring.SqlSessionFactoryBean”;@ConditionalOnMissingClass没有找到不需要的类(OnClassCondition)
– @ConditionalOnBean(类型:javax.sql.DataSource;搜索策略:all)找到bean ‘datasource1’、’datasource2’(OnBeanCondition)
确定匹配MybatisAutoConfiguration#sqlSessionTemplate:
– @ConditionalOnMissingBean(类型:org.mybatis.spring.SqlSessionTemplate;搜索策略:all)没有找到任何bean(OnBeanCondition)
负匹配项:
——————
MybatisAutoConfiguration#sqlSessionFactory:
没有匹配:
– @ConditionalOnMissingBean(类型:org.apache.ibatis.session.SqlSessionFactory;搜索策略:all)找到bean ‘sqlSessionFactory2’、’sqlSessionFactory1’(OnBeanCondition)
MybatisAutoConfiguration.MapperScannerRegistrarNotFoundConfiguration:
没有匹配:
– @ConditionalOnMissingBean(类型:org.mybatis.spring.mapper.MapperFactoryBean;搜索策略:all)找到bean ‘&todoMapper1’、’&todoMapper2’(OnBeanCondition)
排除项:
———–
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
org.springframework.boot.autoconfigure.data.neo4j.Neo4jRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration
org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
org.springframework.boot.autoconfigure.mobile.SitePreferenceAutoConfiguration
org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration
org.springframework.boot.autoconfigure.mail.MailSenderValidatorAutoConfiguration
org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration
org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration
org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration
org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration
org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration
org.springframework.boot.autoconfigure.data.ldap.LdapDataAutoConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration
org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration
org.springframework.boot.autoconfigure.security.FallbackWebSecurityAutoConfiguration
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration
org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration
org.springframework.boot.autoconfigure.social.SocialWebAutoConfiguration
org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration
org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.cassandra.CassandraRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration
org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
org.springframework.boot.autoconfigure.social.FacebookAutoConfiguration
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration
org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration
org.springframework.boot.autoconfigure.webservices.WebServicesAutoConfiguration
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration
org.springframework.boot.autoconfigure.data.ldap.LdapRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration
org.springframework.boot.autoconfigure.cloud.CloudAutoConfiguration
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration
org.springframework.boot.autoconfigure.data.neo4j.Neo4jDataAutoConfiguration
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration
org.springframework.boot.autoconfigure.mobile.DeviceDelegatingViewResolverAutoConfiguration
org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.security.oauth2.OAuth2AutoConfiguration
org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration
org.springframework.boot.autoconfigure.social.TwitterAutoConfiguration
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration
org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration
org.springframework.boot.autoconfigure.social.LinkedInAutoConfiguration
org.springframework.boot.autoconfigure.data.couchbase.CouchbaseRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration
org.springframework.boot.autoconfigure.security.SecurityFilterAutoConfiguration
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration
org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration
org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration
org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration
org.springframework.boot.autoconfigure.mobile.DeviceResolverAutoConfiguration
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketMessagingAutoConfiguration
org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration
org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
无条件类:
———————-
不适用
对比上述内容,可以发现在应用后的结果中,“PositiveMatches”一栏的项目减少了,而在“Exclusions”中记录了被排除的Configuration类组。其中一部分被PositiveMatch的内容与mybatis-spring-boot-starter中定义的Configuration类相关。
总结
在这篇文章中,我展示了如何通过指定Configuration类来禁用Spring Boot的自动配置,并通过使用示例演示了从日志中确认自动配置行为的差异。