Guice700 (original) (raw)

Guice 7.0.0

Released May 12th, 2023.

Maven

Guice:

com.google.inject guice 7.0.0

Extensions:

com.google.inject.extensions guice-${extension} 7.0.0

Downloads

Docs

Changes since Guice 5.1.0

JEE Jakarta Transition

Guice 7.0 ONLY supports the jakarta.inject, jakarta.servlet andjakarta.persistence namespaces. It DOES NOT support javax.inject,javax.servlet, nor javax.persistence. The following links talk more about the jakarta transition:Jarkata EE blog post,Eclipse Foundation blog post,Jakarta EE Wikipedia article,Oracle blog post

Guice 6.0 is being released alongside Guice 7.0 and is intended to help users migrate their code to the jakarta namespace. Guice 6.0 continues to fully support the javax.injectnamespace while also mostly supporting the jakarta.inject namespace. The only part of Guice 6.0 that doesn't support jakarta.inject are thebind(..).toProvider methods.

The Guice 6.0 servlet & persist extensions only support the javax.servlet andjavax.persistence namespaces respectively. If compatibility withjakarta.servlet or jakarta.persistence is required, use Guice 7.0.

Guice 7.0 removes support for javax.inject, javax.servlet andjavax.persistence. Other than the namespace changes, Guice 6.0 & Guice 7.0 are identical.

Details

Guice 6.0 & Guice 7.0 are identical except for the namespaces they support (javax vs jakarta), and were released simultaneously. Thus, this is a changelog from 5.1.0 (not from 6.0.0) to see the meaningful differences since the last release.

See https://github.com/google/guice/compare/5.1.0...7.0.0 for a complete list of changes.

Guice Core

Servlet

Persist

Persist had a number of changes, some of which are backwards incompatible. Notably: injection of EntityManager no longer implicitly starts a unit of work (because this led to leaks). Users can opt-in to the legacy behavior by constructing theJpaPersistModulewith aJpaPersistOptionsthat setssetAutoBeginWorkOnEntityManagerCreationto true.

Struts2

Guice 7.0+ does not include the struts2 extension, because struts2 does not support the jakarta.servlet namespace.