You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2024/10/01 13:39:00 UTC
[jira] [Closed] (MNG-8238) ModelCache incompatible change: computeIfAbsent(org.apache.maven.building.Source, java.lang.String, java.util.function.Supplier)'
[ https://issues.apache.org/jira/browse/MNG-8238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet closed MNG-8238.
--------------------------------
Fix Version/s: (was: 4.0.0-beta-5)
Assignee: Guillaume Nodet
Resolution: Fixed
The {{org.apache.maven.model.building.ModelCache}} is deprecated and unused in Maven 4 anyway, so there's no point in bringing back compatibility for that one at this point.
If an extension is actually using it *and* can work unchanged with the Maven 3 layer, we may want to revert all the changes that happened on the deprecated modules, so that they can work with no change. That's currently not planned.
> ModelCache incompatible change: computeIfAbsent(org.apache.maven.building.Source, java.lang.String, java.util.function.Supplier)'
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: MNG-8238
> URL: https://issues.apache.org/jira/browse/MNG-8238
> Project: Maven
> Issue Type: Bug
> Components: Core
> Affects Versions: 4.0.0-alpha-13
> Reporter: Tamas Cservenak
> Assignee: Guillaume Nodet
> Priority: Major
>
> Maven3 plugin using ModelBuilder gets this:
> {noformat}
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal eu.maveniverse.maven.plugins:toolbox:0.2.4-SNAPSHOT:gav-dm-tree (default-cli) on project unused: Execution default-cli of goal eu.maveniverse.maven.plugins:toolbox:0.2.4-SNAPSHOT:gav-dm-tree failed: An API incompatibility was encountered while executing eu.maveniverse.maven.plugins:toolbox:0.2.4-SNAPSHOT:gav-dm-tree: java.lang.AbstractMethodError: Receiver class eu.maveniverse.maven.mima.extensions.mmr.internal.ModelCacheImpl does not define or inherit an implementation of the resolved method 'abstract java.lang.Object computeIfAbsent(org.apache.maven.building.Source, java.lang.String, java.util.function.Supplier)' of interface org.apache.maven.model.building.ModelCache.
> {noformat}
> Fixing ModelCacheImpl to implement missing methods lead to another issue: missing class {{org.apache.maven.building.Source}} (this class is used by new methods on ModelCache interface). This class belongs to artifact model-builder-support but the Java package {{org.apache.maven.building}} was NEVER exported (nor in mvn3 nor in mvn4).
> Basically, we got to point, that Maven4 broke this compatibility, but there is no way to fix it either, as required class is in not exported package.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)