Hi all,

> Should we migrate existing slf4j calls [in Maven internals] to the Maven 
> Logger?

For Maven internals (maven-core, maven-impl, maven-cli), yes — we
should migrate to
org.apache.maven.api.logging.Logger. The bridge works, but using slf4j
internally
while telling extensions "use our API" is inconsistent. If we believe
our Logger is
the right abstraction, we should model that internally. This is what
#13832 and #14066
started; completing the call-site migration is the logical next step.

> For shared components (maven-shared-*, maven-archiver, maven-filtering…) that 
> can
> also be used outside Maven

This is the harder case. I think the answer depends on the component:

- Components that already depend on Maven 4 API types → migrate to
  org.apache.maven.api.logging.Logger, no extra cost.
- Components that genuinely run standalone or embed into non-Maven
runtimes → keep
  slf4j. Tying them to LoggerManager without a usable standalone shim
is a bad deal
  for external consumers.

> Romain's realm isolation argument

Worth noting that this is currently aspirational rather than enforced:
org.slf4j.* is
today explicitly exported to all plugin realms via
META-INF/maven/extension.xml (both
packages and artifact). So Maven 4 plugins can and do reach for slf4j
— the classloader
boundary doesn't stop them.

This is precisely why the per-realm import descriptor work planned for
plugins in #13223
(Layer 1) matters for logging too. As long as org.slf4j.* is globally
exported to every
plugin realm, plugins will keep using it regardless of what Maven
internals do. The proper
fix needs to happen at the classloader boundary: either stop globally
exporting slf4j to
M4-native plugin realms, or let plugins opt out via
<importedPackages>. Without that,
migrating Maven internals to maven-api-log is only half the job.

Guillaume

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to