gnodet-bot commented on code in PR #13094:
URL: https://github.com/apache/maven/pull/13094#discussion_r4495301488


##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8766SpiWorkspaceReaderTest.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.it;
+
+import java.nio.file.Path;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Integration test for the {@code WorkspaceReader} SPI in maven-api-spi 
(MNG-8766).
+ *
+ * <p>Verifies that SPI workspace readers are:
+ * <ol>
+ *   <li>Discovered via DI and active during the build session</li>
+ *   <li>Consulted for regular artifact resolution (findArtifact, 
findVersions)</li>
+ *   <li>Consulted for model resolution via findModel() — the pre-built {@link 
org.apache.maven.api.model.Model}
+ *       returned by the SPI is passed directly through {@code 
SpiWorkspaceReaderAdapter}
+ *       to the resolver, bypassing {@code ModelProcessor} entirely</li>
+ * </ol>
+ *
+ * <p>The test extension ({@code TestSpiWorkspaceReader}) serves a completely 
synthetic artifact
+ * ({@code org.apache.maven.its.mng8766:virtual-dep:1.0}) that does not exist 
in any repository.
+ * The project POM declares a dependency on this artifact, so Maven must 
consult the workspace reader
+ * for both the artifact file ({@code findArtifact}) and the model ({@code 
findModel}).
+ *

Review Comment:
   🔧 **Nit:** `@since 4.1.0` is inconsistent with the rest of this PR — 
`WorkspaceReader.java` and `SpiWorkspaceReaderAdapter.java` both use `@since 
4.2.0`. Should be:
   
   ```suggestion
    * @since 4.2.0
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to