Use AbstractAotProcessor.AOT_PROCESSING instead of duplicate constant

Closes gh-42461
This commit is contained in:
Stéphane Nicoll
2024-10-18 08:07:45 +02:00
parent 5806915155
commit b7979cf443
9 changed files with 18 additions and 9 deletions

View File

@@ -36,6 +36,7 @@ import org.springframework.boot.docker.compose.lifecycle.DockerComposeProperties
import org.springframework.boot.docker.compose.lifecycle.DockerComposeProperties.Stop;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.aot.AbstractAotProcessor;
import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.core.log.LogMessage;
import org.springframework.util.Assert;
@@ -95,7 +96,7 @@ class DockerComposeLifecycleManager {
}
void start() {
if (Boolean.getBoolean("spring.aot.processing") || AotDetector.useGeneratedArtifacts()) {
if (Boolean.getBoolean(AbstractAotProcessor.AOT_PROCESSING) || AotDetector.useGeneratedArtifacts()) {
logger.trace("Docker Compose support disabled with AOT and native images");
return;
}

View File

@@ -44,6 +44,7 @@ import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.aot.AbstractAotProcessor;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.util.FileCopyUtils;
@@ -126,7 +127,7 @@ class DockerComposeLifecycleManagerTests {
@Test
void startWhenAotProcessingDoesNotStart() {
withSystemProperty("spring.aot.processing", "true", () -> {
withSystemProperty(AbstractAotProcessor.AOT_PROCESSING, "true", () -> {
EventCapturingListener listener = new EventCapturingListener();
this.eventListeners.add(listener);
setUpRunningServices();