|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
16 | 16 |
|
17 | 17 | package org.springframework.context.support
|
18 | 18 |
|
19 |
| -import org.springframework.aot.AotDetector |
20 | 19 | import org.springframework.beans.factory.ObjectProvider
|
| 20 | +import org.springframework.beans.factory.aot.BeanRegistrationAotProcessor |
21 | 21 | import org.springframework.beans.factory.config.BeanDefinition
|
22 | 22 | import org.springframework.beans.factory.config.BeanDefinitionCustomizer
|
23 | 23 | import org.springframework.beans.factory.getBeanProvider
|
@@ -191,6 +191,7 @@ open class BeanDefinitionDsl internal constructor (private val init: BeanDefinit
|
191 | 191 | description?.let { bd.description = description }
|
192 | 192 | role?.let { bd.role = role.ordinal }
|
193 | 193 | order?.let { bd.setAttribute(AbstractBeanDefinition.ORDER_ATTRIBUTE, order) }
|
| 194 | + bd.setAttribute(BeanRegistrationAotProcessor.IGNORE_REGISTRATION_ATTRIBUTE, true) |
194 | 195 | }
|
195 | 196 |
|
196 | 197 | val beanName = name ?: BeanDefinitionReaderUtils.uniqueBeanName(T::class.java.name, context);
|
@@ -237,6 +238,7 @@ open class BeanDefinitionDsl internal constructor (private val init: BeanDefinit
|
237 | 238 | description?.let { bd.description = description }
|
238 | 239 | role?.let { bd.role = role.ordinal }
|
239 | 240 | order?.let { bd.setAttribute(AbstractBeanDefinition.ORDER_ATTRIBUTE, order) }
|
| 241 | + bd.setAttribute(BeanRegistrationAotProcessor.IGNORE_REGISTRATION_ATTRIBUTE, true) |
240 | 242 | }
|
241 | 243 |
|
242 | 244 |
|
@@ -1199,9 +1201,6 @@ open class BeanDefinitionDsl internal constructor (private val init: BeanDefinit
|
1199 | 1201 | * @param context The `ApplicationContext` to use for registering the beans
|
1200 | 1202 | */
|
1201 | 1203 | override fun initialize(context: GenericApplicationContext) {
|
1202 |
| - if (AotDetector.useGeneratedArtifacts()) { |
1203 |
| - return |
1204 |
| - } |
1205 | 1204 | this.context = context
|
1206 | 1205 | init()
|
1207 | 1206 | for (child in children) {
|
|
0 commit comments