Skip CRaC support with native images
Skip CRaC support with native images to avoid compiling related infrastructure to the native image and to fix tests via gh-30422. See gh-30242
This commit is contained in:
parent
f469eff97b
commit
9fec516560
|
|
@ -43,6 +43,7 @@ import org.springframework.context.Lifecycle;
|
|||
import org.springframework.context.LifecycleProcessor;
|
||||
import org.springframework.context.Phased;
|
||||
import org.springframework.context.SmartLifecycle;
|
||||
import org.springframework.core.NativeDetector;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
|
@ -79,7 +80,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
|||
|
||||
|
||||
public DefaultLifecycleProcessor() {
|
||||
if (ClassUtils.isPresent("org.crac.Core", getClass().getClassLoader())) {
|
||||
if (!NativeDetector.inNativeImage() && ClassUtils.isPresent("org.crac.Core", getClass().getClassLoader())) {
|
||||
this.cracResource = new CracDelegate().registerResource();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue