[
https://issues.apache.org/jira/browse/MNG-7924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17784348#comment-17784348
]
ASF GitHub Bot commented on MNG-7924:
-------------------------------------
cstamas commented on code in PR #1299:
URL: https://github.com/apache/maven/pull/1299#discussion_r1387786371
##########
maven-core/src/main/java/org/apache/maven/artifact/handler/manager/LegacyArtifactHandlerManager.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.artifact.handler.manager;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+/**
+ */
+@Named
+@Singleton
+public class LegacyArtifactHandlerManager implements ArtifactHandlerManager {
Review Comment:
This is a simple trick:
* legacyAHM is what "default" was so far (it have legacy AHs injected), is
new, but nobody uses it as it is new thing (just new code "knows" about it)
* defaultAHM changed to delegate calls to typeRegistry
* typeRegistry uses as a fallback legacyAHM
This completes the circle:
* legacy code will refer to defaultAHM that goes to typeRegistry that will
refer legacyAHM (as fallback)
* new code will refer to typeRegistry
This way new and legacy code both "see" the same thing: whether it is new AH
(legacy) or Type (new) being added by extension for example
> Better control over and better integration with Resolver
> --------------------------------------------------------
>
> Key: MNG-7924
> URL: https://issues.apache.org/jira/browse/MNG-7924
> Project: Maven
> Issue Type: Task
> Components: Artifacts and Repositories
> Reporter: Tamas Cservenak
> Priority: Major
> Fix For: 4.0.0-alpha-9
>
>
> Integrate better and obtain better control over Resolver. These changes did
> stem from "[JPMS module
> experiment|https://cwiki.apache.org/confluence/display/MAVEN/Experiment+-+Explicit+JPMS+support]"
> and are considered improvement but *does not implement any functionality*
> related to JPMS module support.
> Changes:
> * Maven4 should stop "disconnected coexistence" of two type systems
> (ArtifactHandlers and Resolver ArtifactTypeRegistry), it should unify them.
> * Maven4 Core should provide generic and extensible means to introduce new
> artifact types (fully in extension, and extension should get extended data
> via "roundtrip" in core/resolver)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)