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


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java:
##########
@@ -442,6 +442,18 @@ public final class Constants {
     @Config
     public static final String MAVEN_REPO_LOCAL_TAIL_IGNORE_AVAILABILITY = 
"maven.repo.local.tail.ignoreAvailability";
 
+    /**
+     * Whether cached artifacts may be reused independently of their recorded 
remote repository origin.
+     * By default this is enabled for unsplit enhanced local repositories, 
including chain members,
+     * unless an explicit tail availability policy requests strict checking. 
Split repositories retain
+     * origin checking by default. An explicit value overrides this automatic 
policy.
+     * Provenance is still recorded; metadata and snapshot version discovery 
are unchanged.
+     *
+     * @since 4.2.0
+     */
+    @Config(defaultValue = "true for unsplit repositories unless tail 
availability checking is explicitly enabled")
+    public static final String MAVEN_REPO_LOCAL_IGNORE_AVAILABILITY = 
"maven.repo.local.ignoreAvailability";

Review Comment:
   `defaultValue` in `@Config` must be a parseable value, not explanatory 
prose. The annotation processor uses it to generate default-value documentation 
and potentially validation — a human-readable sentence breaks that contract.
   
   The neighboring `MAVEN_REPO_LOCAL_TAIL_IGNORE_AVAILABILITY` constant uses a 
bare `@Config` with no `defaultValue`, which is correct when the default is 
conditional.
   
   ```java
   // Use type declaration + move the conditional explanation into the Javadoc 
(already present)
   @Config(type = "java.lang.Boolean")
   public static final String MAVEN_REPO_LOCAL_IGNORE_AVAILABILITY = ...
   ```
   
   The Javadoc block above already explains the conditional default behaviour — 
that is exactly the right place for it.



##########
its/core-it-suite/src/test/java/org/apache/maven/it/MavenITLocalRepositoryOriginPolicyTest.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.Files;
+import java.nio.file.Path;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/** Verifies origin-independent reuse across real Maven invocations, without 
plugin or network dependencies. */
+class MavenITLocalRepositoryOriginPolicyTest extends 
AbstractMavenIntegrationTestCase {
+    @Test

Review Comment:
   New IT classes should use the `MavenITgh<N>` naming convention to link the 
test to the GitHub issue. Consider renaming to 
`MavenITgh14082LocalRepositoryOriginPolicyTest` (the fix targets issue #14082). 
Low severity — does not affect correctness.



-- 
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