[ https://issues.apache.org/jira/browse/MNG-8238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879192#comment-17879192 ]
Tamas Cservenak commented on MNG-8238: -------------------------------------- Things are like following: * maven 3.8.x have DefaultModelCache that is package protected, but have static public factory method (but given class is package protected, is unusable) * maven 3.9.x have DefaultModelCacheFactory that may be used * maven 4.0.x changed ModelCache interface and uses class on API that is (and never was) exported from Maven Core (the {{org.apache.maven.building.Source}} class). So currently there is no model cache solution that would cover 3.8-4.0. > 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-beta-4 > Reporter: Tamas Cservenak > Priority: Major > Fix For: 4.0.0-beta-5 > > > 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)