Skip to content

Gradle 9 prereq: remove smoke test dependencies on Spring Boot launcher#4616

Closed
trask wants to merge 1 commit intomainfrom
gradle9-prereq-spring2
Closed

Gradle 9 prereq: remove smoke test dependencies on Spring Boot launcher#4616
trask wants to merge 1 commit intomainfrom
gradle9-prereq-spring2

Conversation

@trask
Copy link
Member

@trask trask commented Feb 6, 2026

Keeping dependencies on Spring, only removing dependencies on Spring Boot launcher.

Reason: upgrading to Gradle 9.3.1 forces an upgrade of Spring Boot Gradle plugin from 2.5.12 to 3.4.2 (Spring Boot 2.7.x uses deprecated Gradle APIs removed in Gradle 9). Spring Boot 3.x compiles its bootJar launcher classes for Java 17+, making it impossible to run these JARs on Java 8 (which we want to continue testing against).

Convert remaining smoke tests from Spring Boot to embedded Tomcat + Spring MVC
to preserve Java 8 test coverage:

- JettyNativeHandler: Remove unused Spring Boot dependency
- gRPC: Replace Spring Boot with embedded Tomcat + Spring MVC + gRPC server
- RuntimeAttach: Preserve ApplicationInsights.attach() call
- RuntimeAttachWithDelayedConnectionString: Preserve ConnectionString.configure()
- SystemExit: Preserve System.exit() test logic (added SLF4J for logging)
- AzureFunctions: Preserve Azure Functions worker simulation

All tests now use Java 8-compatible dependencies:
- spring-webmvc:5.3.39
- tomcat-embed-core:9.0.98
- javax.servlet-api:4.0.1

This avoids Spring Boot 3.x's Java 17 launcher requirement entirely while
maintaining full Java 8 test coverage.
@trask trask force-pushed the gradle9-prereq-spring2 branch from b0970af to 8571c80 Compare February 6, 2026 20:06
@trask trask changed the title Gradle 9 prereq: remove testing dependency on Spring Boot Gradle 9 prereq: remove testing dependencies on Spring Boot Feb 6, 2026
@trask trask changed the title Gradle 9 prereq: remove testing dependencies on Spring Boot Gradle 9 prereq: remove smoke test dependencies on Spring Boot launcher Feb 6, 2026
@trask trask marked this pull request as ready for review February 6, 2026 22:38
Comment on lines +37 to +53
// Start embedded Tomcat with Spring MVC
Tomcat tomcat = new Tomcat();
tomcat.setPort(8080);
tomcat.getConnector();
Context context = tomcat.addContext("", System.getProperty("java.io.tmpdir"));

AnnotationConfigWebApplicationContext appContext = new AnnotationConfigWebApplicationContext();
appContext.setServletContext(context.getServletContext());
appContext.register(SpringBootApp.class);
appContext.refresh();

DispatcherServlet dispatcher = new DispatcherServlet(appContext);
Tomcat.addServlet(context, "dispatcher", dispatcher).setLoadOnStartup(1);
context.addServletMappingDecoded("/*", "dispatcher");

tomcat.start();
tomcat.getServer().await();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a good bit of duplication of this block of code among these tests

I think that's ok since these are "standalone applications under test"

@trask trask closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant