Hi Tony,

A quick follow-up: the fix is merged on master and on the 4.0.x branch
(https://github.com/apache/maven/pull/13301), so next 4.x will ship
maven-settings without the duplicate org.apache.maven.settings.v4 classes.
Once you move to it, you can drop the banDuplicateClasses exclusion.

Thanks again for the report.

Sylwester

On 2026/09/28 14:27:20 Sylwester Lachiewicz wrote:
> Hi Tony,
> 
> Thanks for the report. The duplication is not intentional. maven-support
> and maven-settings both generate org.apache.maven.settings.v4 from the same
> settings.mdo, so each jar ships its own copy of the same 11 classes.
> maven-model and maven-toolchain-model already avoid this by taking the v4
> readers, writers and mergers from maven-support. maven-settings should do
> the same.
> 
> Fix proposal: https://github.com/apache/maven/pull/13289 It targets master
> and is labelled for backport to 4.0.x.
> 
> Until a release includes it, you can safely exclude these classes in
> banDuplicateClasses, because they are byte-identical:
> 
> <ignoreClasses>
> <ignoreClass>org.apache.maven.settings.v4.*</ignoreClass>
> </ignoreClasses>
> 
> Sylwester
> 
> On Mon, Sep 28, 2026 03:03 PM, "Tony Chemit (dev)" <[email protected]> wrote:
> 
> > Hi Maven developers,
> >
> > We are adopting Maven 4 for our company projects, including custom Maven
> > plugins.
> >
> > With Maven dependencies aligned to 4.0.0-rc-7, Enforcer reports 11
> > duplicate classes in:
> >
> >   * |org.apache.maven:maven-support|
> >   * |org.apache.maven:maven-settings|
> >
> > The duplicates are under |org.apache.maven.settings.v4|and have
> > identical byte-code.
> >
> > Both artifacts arrive transitively through Maven’s own dependencies.
> >
> > Is this duplication intentional, or should it be fixed in Maven’s
> > published artifacts?
> >
> > Long live Maven 4, and thank you for all your hard work!
> >
> > Thanks,
> > Tony
> >
> >
> 

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

Reply via email to