Affects: All current spring framework versions

HtmlUnit has released version 3.0.0 on March 19. With this version the artifact has changed from org.htmlunit/htmlunit:htmlunit to org.htmlunit:htmlunit as well as all the packages have changed from com.gargoylesoftware.htmlunit.* to org.htmlunit.*. New updates only seem to be done on the 3.x line, and no longer on the 2.x line. Spring should probably be updated accordingly.

Since 3.0.0 has some incompatible changes compared to 2.70.0, this upgrade should probably not be done on a point release.

From the Spring perspective, I don't think it's much more than updating all the packages and artifact, both in code and documentation.

Comment From: tedyoung

Is there a way to create a backwards-compatible version of MockMvcWebClientBuilder that can accept either the old or new package name for HtmlUnit's WebClient?

Comment From: svschouw-bb

I'm afraid the MockMvcWebClientBuilder.build() method signature would not be compatible (it would have to either return com.gargoylesoftware.htmlunit.WebClient or org.htmlunit.WebClient). It's probably possible to create a MockMvcWebClient3Builder by just copy-pasting all relevant files. But probably the entire package will have to be copy-pasted. It might be possible to share some code if an adapter for the various HttpClient classes (like WebRequest and WebResponse) were created, but I'm not sure if that's worth it in the long run. Maybe create a org.springframework.test.web.servlet.htmlunit3 package and deprecate the old one. And in a later version delete the old one.

Comment From: snicoll

We'd have to coordinate with Spring Boot, as a move to 3.0 can only be done for 3.3 at the earliest (which means Spring Framework 6.1.x).

@jhoeller wondering if we're ok to raise the baseline for this dependency?

Comment From: tschuehly

HtmlUnit 4 is due to be released at the beginning of April. Would be cool if we could upgrade directly to 4.0: https://twitter.com/HtmlUnit/status/1766518473042137369?t=vTlcCbA-JTJouE15zFkcXA&s=19

Comment From: jhoeller

@tschuehly I see no structural changes on HtmlUnit's main branch, just removed IE support on existing files in org.htmlunit. So it looks like we'll be fine with our present arrangement covering both 3.11 and 4.0 there. We'll see once HtmlUnit 4.0 is actually out.

Comment From: tschuehly

@jhoeller Great to hear!