인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

soojinkimss님의 프로필 이미지
soojinkimss

작성한 질문수

스프링 핵심 원리 - 기본편

애노테이션 직접 만들기

contextLoads()

작성

·

35

0

[질문 내용]

설정에서 Gradle로 변경 시 실행했을 때 나오는 도큐먼트
============================

CONDITIONS EVALUATION REPORT

============================

Positive matches:

-----------------

AopAutoConfiguration matched:

- @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)

AopAutoConfiguration.ClassProxyingConfiguration matched:

- @ConditionalOnMissingClass did not find unwanted class 'org.aspectj.weaver.Advice' (OnClassCondition)

- @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)

ApplicationAvailabilityAutoConfiguration#applicationAvailability matched:

- @ConditionalOnMissingBean (types: org.springframework.boot.availability.ApplicationAvailability; SearchStrategy: all) did not find any beans (OnBeanCondition)

GenericCacheConfiguration matched:

- Cache org.springframework.boot.autoconfigure.cache.GenericCacheConfiguration automatic cache type (CacheCondition)

LifecycleAutoConfiguration#defaultLifecycleProcessor matched:

- @ConditionalOnMissingBean (names: lifecycleProcessor; SearchStrategy: current) did not find any beans (OnBeanCondition)

NoOpCacheConfiguration matched:

- Cache org.springframework.boot.autoconfigure.cache.NoOpCacheConfiguration automatic cache type (CacheCondition)

PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:

- @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)

SimpleCacheConfiguration matched:

- Cache org.springframework.boot.autoconfigure.cache.SimpleCacheConfiguration automatic cache type (CacheCondition)

SqlInitializationAutoConfiguration matched:

- @ConditionalOnProperty (spring.sql.init.enabled) matched (OnPropertyCondition)

- NoneNestedConditions 0 matched 1 did not; NestedCondition on SqlInitializationAutoConfiguration.SqlInitializationModeCondition.ModeIsNever @ConditionalOnProperty (spring.sql.init.mode=never) did not find property 'mode' (SqlInitializationAutoConfiguration.SqlInitializationModeCondition)

SslAutoConfiguration#sslBundleRegistry matched:

- @ConditionalOnMissingBean (types: org.springframework.boot.ssl.SslBundleRegistry,org.springframework.boot.ssl.SslBundles; SearchStrategy: all) did not find any beans (OnBeanCondition)

TaskExecutionAutoConfiguration matched:

- @ConditionalOnClass found required class 'org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor' (OnClassCondition)

TaskExecutorConfigurations.SimpleAsyncTaskExecutorBuilderConfiguration#simpleAsyncTaskExecutorBuilder matched:

- @ConditionalOnMissingBean (types: org.springframework.boot.task.SimpleAsyncTaskExecutorBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)

- @ConditionalOnThreading found PLATFORM (OnThreadingCondition)

TaskExecutorConfigurations.TaskExecutorConfiguration matched:

- @ConditionalOnMissingBean (types: java.util.concurrent.Executor; SearchStrategy: all) did not find any beans (OnBeanCondition)

TaskExecutorConfigurations.TaskExecutorConfiguration#applicationTaskExecutor matched:

- @ConditionalOnThreading found PLATFORM (OnThreadingCondition)

TaskExecutorConfigurations.ThreadPoolTaskExecutorBuilderConfiguration#threadPoolTaskExecutorBuilder matched:

- @ConditionalOnMissingBean (types: org.springframework.boot.task.ThreadPoolTaskExecutorBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)

TaskSchedulingAutoConfiguration matched:

- @ConditionalOnClass found required class 'org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler' (OnClassCondition)

TaskSchedulingConfigurations.SimpleAsyncTaskSchedulerBuilderConfiguration#simpleAsyncTaskSchedulerBuilder matched:

- @ConditionalOnMissingBean (types: org.springframework.boot.task.SimpleAsyncTaskSchedulerBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)

- @ConditionalOnThreading found PLATFORM (OnThreadingCondition)

TaskSchedulingConfigurations.ThreadPoolTaskSchedulerBuilderConfiguration#threadPoolTaskSchedulerBuilder matched:

- @ConditionalOnMissingBean (types: org.springframework.boot.task.ThreadPoolTaskSchedulerBuilder; SearchStrategy: all) did not find any beans (OnBeanCondition)

Negative matches:

-----------------

ActiveMQAutoConfiguration:

Did not match:

- @ConditionalOnClass did not find required class 'jakarta.jms.ConnectionFactory' (OnClassCondition)

AopAutoConfiguration.AspectJAutoProxyingConfiguration:

Did not match:

- @ConditionalOnClass did not find required class 'org.aspectj.weaver.Advice' (OnClassCondition)

ArtemisAutoConfiguration:

....


Exclusions:

-----------

None

Unconditional classes:

----------------------

org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration

org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration

org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration

org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration

org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration

org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration



설정에서 Intellij IDEA로 변경 시 나오는 도큐먼트
java.lang.IllegalStateException: Failed to load ApplicationContext for [MergedContextConfiguration@68ab0936 testClass = hello.core.CoreApplicationTests, locations = [], classes = [hello.core.CoreApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.OnFailureConditionReportContextCustomizerFactory$OnFailureConditionReportContextCustomizer@602c4656, org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@a8a8b75, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@155d1021, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@deb3b60, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@54acff7d, org.springframework.test.context.support.DynamicPropertiesContextCustomizer@0, org.springframework.boot.test.context.SpringBootTestAnnotation@b2fce02d], contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]

우선 초반부터 설정부분에서 Intellij IDEA로 지정하면서 강의를 진행하였습니다. 그러나 중간쯤 테스트 하위클래스에 CoreApplicationTest contextLoads()가 계속 오류가 나길래 인프런에 질문 목록들을 참고하면서 알아본 결과 스프링 부트 3.X 이상부터는 호환성 문제로 설정에서 Gradle에 들어가서 Intellij IDEA에서 Gradle로 바꾸면 테스트를 모두 실행했을 때 오류가 뜨진 않게 되는데요. 그래도 콘솔에서는 아주아주 긴 설명문이 나옵니다. 물론 실행 속도도 현저히 느리게 되었구요. 결론은 꼭 Gradle로 바꾸는 방법 말고 Intellij IDEA로 계속 하면서 다른 해결방법이 없나 궁금합니다.

답변 1

0

안녕하세요. soojinkimss님, 공식 서포터즈 y2gcoder입니다.

먼저 두 가지 이유에서 build tool을 gradle로 하시길 권해드립니다.

  • 배포환경과의 일치: 실제 실무 시에는 보통 Gradle 이나 Maven과 같은 빌드 도구를 사용해 프로젝트를 관리합니다! soojinkimss 님께서도 겪으셨겠지만 build tool을 Intellij IDEA 자체 빌드 도구로 변경함에 따라 빌드되던 프로젝트가 빌드가 되지 않기도 하는 등 일부 의존성 문제나 호환성 문제가 발생할 수 있습니다.

  • 프로젝트 코드 변경 없음: 빌드 툴을 gradle 로 했을 때 기존 애플리케이션 코드 변경이나 IDE 설정 변경 없이 사용할 수 있기 때문에 gradle을 권해드리는 편입니다.

다만 위의 내용을 인지한 채로 학습 시 빌드 속도가 느려지는 점을 개선하고 싶어 intellij 를 빌드 툴로 계속 사용하고 싶으시다면 자주하는 질문(링크) 를 읽어보시고 해결방안 1, 해결방안 2 중에 하나를 선택해서 적용해보시길 권해드립니다!

감사합니다.

soojinkimss님의 프로필 이미지
soojinkimss

작성한 질문수

질문하기