elharo commented on code in PR #389: URL: https://github.com/apache/maven-build-cache-extension/pull/389#discussion_r4388427076
########## src/test/java/org/apache/maven/buildcache/xml/PluginParameterValidationTest.java: ########## @@ -0,0 +1,185 @@ +/* + * 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.buildcache.xml; + +import org.apache.maven.buildcache.xml.PluginParameterDefinition.GoalParameterDefinition; +import org.apache.maven.buildcache.xml.PluginParameterDefinition.ParameterDefinition; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests for plugin parameter definition loading and validation system + */ +class PluginParameterValidationTest { + + @Test + void testLoadMavenCompilerPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); + + assertNotNull(def, "Should load maven-compiler-plugin definition"); + assertEquals("org.apache.maven.plugins", def.getGroupId()); + assertEquals("maven-compiler-plugin", def.getArtifactId()); + + // Verify compile goal exists + GoalParameterDefinition compileGoal = def.getGoal("compile"); + assertNotNull(compileGoal, "compile goal should exist"); + + // Verify cache-key parameters + assertTrue(compileGoal.hasParameter("source"), "Should have 'source' parameter"); + assertTrue(compileGoal.hasParameter("target"), "Should have 'target' parameter"); + assertTrue(compileGoal.hasParameter("release"), "Should have 'release' parameter"); + + ParameterDefinition sourceParam = compileGoal.getParameter("source"); + assertTrue(sourceParam.isCacheKey()); + + // Parameters without cache-key metadata default to false + assertTrue(compileGoal.hasParameter("verbose"), "Should have 'verbose' parameter"); + ParameterDefinition verboseParam = compileGoal.getParameter("verbose"); + assertTrue(!verboseParam.isCacheKey()); + } + + @Test + void testLoadMavenInstallPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-install-plugin"); + + assertNotNull(def, "Should load maven-install-plugin definition"); + assertEquals("org.apache.maven.plugins", def.getGroupId()); + assertEquals("maven-install-plugin", def.getArtifactId()); + + // Verify install goal exists + GoalParameterDefinition installGoal = def.getGoal("install"); + assertNotNull(installGoal, "install goal should exist"); + + // The lifecycle install goal exposes cache-key parameters. + assertTrue(installGoal.hasParameter("skip"), "Should have 'skip' parameter"); + ParameterDefinition skipParam = installGoal.getParameter("skip"); + assertTrue(skipParam.isCacheKey()); + } + + @Test + void testDefaultReconciliationParametersAreValid() { + PluginParameterLoader loader = new PluginParameterLoader(); + + // Verify that default reconciliation parameters for maven-compiler-plugin are valid + PluginParameterDefinition compilerDef = loader.load("maven-compiler-plugin"); + assertNotNull(compilerDef); + + GoalParameterDefinition compileGoal = compilerDef.getGoal("compile"); + assertNotNull(compileGoal); + + // All default parameters should exist and be cache keys + String[] defaultParams = {"source", "target", "release"}; + for (String paramName : defaultParams) { + assertTrue( + compileGoal.hasParameter(paramName), + "Default parameter '" + paramName + "' should exist in compile goal"); + + ParameterDefinition param = compileGoal.getParameter(paramName); + assertTrue(param.isCacheKey(), "Default parameter '" + paramName + "' should be a cache key"); + } + + // Verify testCompile goal has same parameters + GoalParameterDefinition testCompileGoal = compilerDef.getGoal("testCompile"); + assertNotNull(testCompileGoal); + + for (String paramName : defaultParams) { + assertTrue( + testCompileGoal.hasParameter(paramName), + "Default parameter '" + paramName + "' should exist in testCompile goal"); + } + } + + @Test + void testVersionSpecificParameterLoading() { + PluginParameterLoader loader = new PluginParameterLoader(); + + // Load for version 1.5.0 - should get 1.0.0 definition (highest minVersion <= 1.5.0) + PluginParameterDefinition def1 = loader.load("maven-versioned-plugin", "1.5.0"); Review Comment: avoid abbreviation ########## src/site/markdown/how-to.md: ########## @@ -169,6 +169,177 @@ Add `executionControl/runAlways` section: </executionControl> ``` +### Default Reconciliation Behavior + +The build cache extension automatically tracks certain critical plugin properties by default, even without explicit +`executionControl` configuration. These defaults are derived from plugin parameter descriptors under +`plugin-parameters/`: + +* **maven-compiler-plugin** (`compile` and `testCompile` goals): Tracks parameters marked `<cache-key>true</cache-key>` in + `plugin-parameters/maven-compiler-plugin.xml` +* **maven-install-plugin** (`install` and `install-file` goals): Tracks parameters marked `<cache-key>true</cache-key>` in + `plugin-parameters/maven-install-plugin.xml` + +This default behavior prevents common cache invalidation issues, particularly in multi-module JPMS (Java Platform Module System) +projects where compiler version changes can cause compilation failures. + +**Overriding Defaults:** When you explicitly configure `executionControl` for a plugin goal, your explicit configuration Review Comment: your explicit --> the explicit ########## src/test/java/org/apache/maven/buildcache/xml/PluginParameterValidationTest.java: ########## @@ -0,0 +1,185 @@ +/* + * 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.buildcache.xml; + +import org.apache.maven.buildcache.xml.PluginParameterDefinition.GoalParameterDefinition; +import org.apache.maven.buildcache.xml.PluginParameterDefinition.ParameterDefinition; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests for plugin parameter definition loading and validation system + */ +class PluginParameterValidationTest { + + @Test + void testLoadMavenCompilerPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); + + assertNotNull(def, "Should load maven-compiler-plugin definition"); + assertEquals("org.apache.maven.plugins", def.getGroupId()); + assertEquals("maven-compiler-plugin", def.getArtifactId()); + + // Verify compile goal exists + GoalParameterDefinition compileGoal = def.getGoal("compile"); + assertNotNull(compileGoal, "compile goal should exist"); + + // Verify cache-key parameters + assertTrue(compileGoal.hasParameter("source"), "Should have 'source' parameter"); + assertTrue(compileGoal.hasParameter("target"), "Should have 'target' parameter"); + assertTrue(compileGoal.hasParameter("release"), "Should have 'release' parameter"); + + ParameterDefinition sourceParam = compileGoal.getParameter("source"); + assertTrue(sourceParam.isCacheKey()); + + // Parameters without cache-key metadata default to false + assertTrue(compileGoal.hasParameter("verbose"), "Should have 'verbose' parameter"); + ParameterDefinition verboseParam = compileGoal.getParameter("verbose"); + assertTrue(!verboseParam.isCacheKey()); + } + + @Test + void testLoadMavenInstallPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-install-plugin"); Review Comment: definition ########## src/test/java/org/apache/maven/buildcache/xml/AutoTrackingCacheKeyParametersTest.java: ########## @@ -0,0 +1,144 @@ +/* + * 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.buildcache.xml; + +import java.util.Set; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests that auto-tracking from plugin parameter definitions works correctly. + * Verifies that all cache-key parameters are automatically tracked, not just a subset. + */ +class AutoTrackingCacheKeyParametersTest { + + @Test + void testMavenCompilerPluginAutoTracksAllCacheKeyParameters() { + // This test verifies that the auto-generation tracks ALL cache-key parameters, + // not just the 3 that were in the old defaults.xml (source, target, release) + + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); + + assertNotNull(def, "Should load maven-compiler-plugin definition"); + + PluginParameterDefinition.GoalParameterDefinition compileGoal = def.getGoal("compile"); + assertNotNull(compileGoal, "compile goal should exist"); + + // Get all cache-key parameter names from the XML definition + Set<String> cacheKeyParams = compileGoal.getParameters().values().stream() + .filter(PluginParameterDefinition.ParameterDefinition::isCacheKey) + .map(PluginParameterDefinition.ParameterDefinition::getName) + .collect(Collectors.toSet()); + + // Verify we have more than just the original 3 from defaults.xml + assertTrue( + cacheKeyParams.size() > 3, + "Should have more than 3 cache-key parameters (was: " + cacheKeyParams.size() + ")"); + + // Verify the original 3 are included + assertTrue(cacheKeyParams.contains("source"), "Should include 'source' parameter"); + assertTrue(cacheKeyParams.contains("target"), "Should include 'target' parameter"); + assertTrue(cacheKeyParams.contains("release"), "Should include 'release' parameter"); + + // Verify additional cache-key parameters are included (these were NOT in defaults.xml) + assertTrue( + cacheKeyParams.contains("encoding"), + "Should include 'encoding' parameter (auto-tracked, not in old defaults.xml)"); + assertTrue( + cacheKeyParams.contains("debug"), + "Should include 'debug' parameter (auto-tracked, not in old defaults.xml)"); + assertTrue( + cacheKeyParams.contains("compilerArgs"), + "Should include 'compilerArgs' parameter (auto-tracked, not in old defaults.xml)"); + assertTrue( + cacheKeyParams.contains("annotationProcessorPaths"), + "Should include 'annotationProcessorPaths' parameter (auto-tracked, not in old defaults.xml)"); + for (String paramName : new String[] { + "showWarnings", + "showDeprecation", + "fork", + "maxmem", + "meminitial", + "failOnError", + "failOnWarning", + "forceJavacCompilerUse", + "staleMillis", + "useIncrementalCompilation" + }) { + assertTrue( + cacheKeyParams.contains(paramName), + "Should include '" + paramName + "' because changing it can cause a cache miss"); + } + } + + @Test + void testMavenInstallPluginAutoTracksAllCacheKeyParameters() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-install-plugin"); + + assertNotNull(def, "Should load maven-install-plugin definition"); + + PluginParameterDefinition.GoalParameterDefinition installGoal = def.getGoal("install"); + assertNotNull(installGoal, "install goal should exist"); + + // Get all cache-key parameter names + Set<String> cacheKeyParams = installGoal.getParameters().values().stream() + .filter(PluginParameterDefinition.ParameterDefinition::isCacheKey) + .map(PluginParameterDefinition.ParameterDefinition::getName) + .collect(Collectors.toSet()); + + // The old defaults.xml had NO properties listed for maven-install-plugin + // Now auto-tracking should track all cache-key parameters + assertTrue(cacheKeyParams.size() > 0, "Should auto-track cache-key parameters (old defaults.xml had 0)"); + + // Coordinates are parameters of install-file; install exposes its output-affecting controls. + assertTrue(cacheKeyParams.contains("skip"), "Should track 'skip' parameter"); + assertTrue(cacheKeyParams.contains("installAtEnd"), "Should track 'installAtEnd' parameter"); + } + + @Test + void testNonCacheKeyParametersNotAutoTracked() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); Review Comment: definition ########## src/test/java/org/apache/maven/buildcache/xml/PluginParameterValidationTest.java: ########## @@ -0,0 +1,185 @@ +/* + * 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.buildcache.xml; + +import org.apache.maven.buildcache.xml.PluginParameterDefinition.GoalParameterDefinition; +import org.apache.maven.buildcache.xml.PluginParameterDefinition.ParameterDefinition; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests for plugin parameter definition loading and validation system + */ +class PluginParameterValidationTest { + + @Test + void testLoadMavenCompilerPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); Review Comment: definition ########## src/test/java/org/apache/maven/buildcache/xml/PluginParameterValidationTest.java: ########## @@ -0,0 +1,185 @@ +/* + * 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.buildcache.xml; + +import org.apache.maven.buildcache.xml.PluginParameterDefinition.GoalParameterDefinition; +import org.apache.maven.buildcache.xml.PluginParameterDefinition.ParameterDefinition; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests for plugin parameter definition loading and validation system + */ +class PluginParameterValidationTest { + + @Test + void testLoadMavenCompilerPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); + + assertNotNull(def, "Should load maven-compiler-plugin definition"); + assertEquals("org.apache.maven.plugins", def.getGroupId()); + assertEquals("maven-compiler-plugin", def.getArtifactId()); + + // Verify compile goal exists + GoalParameterDefinition compileGoal = def.getGoal("compile"); + assertNotNull(compileGoal, "compile goal should exist"); + + // Verify cache-key parameters + assertTrue(compileGoal.hasParameter("source"), "Should have 'source' parameter"); + assertTrue(compileGoal.hasParameter("target"), "Should have 'target' parameter"); + assertTrue(compileGoal.hasParameter("release"), "Should have 'release' parameter"); + + ParameterDefinition sourceParam = compileGoal.getParameter("source"); + assertTrue(sourceParam.isCacheKey()); + + // Parameters without cache-key metadata default to false + assertTrue(compileGoal.hasParameter("verbose"), "Should have 'verbose' parameter"); + ParameterDefinition verboseParam = compileGoal.getParameter("verbose"); + assertTrue(!verboseParam.isCacheKey()); + } + + @Test + void testLoadMavenInstallPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-install-plugin"); + + assertNotNull(def, "Should load maven-install-plugin definition"); + assertEquals("org.apache.maven.plugins", def.getGroupId()); + assertEquals("maven-install-plugin", def.getArtifactId()); + + // Verify install goal exists + GoalParameterDefinition installGoal = def.getGoal("install"); + assertNotNull(installGoal, "install goal should exist"); + + // The lifecycle install goal exposes cache-key parameters. + assertTrue(installGoal.hasParameter("skip"), "Should have 'skip' parameter"); + ParameterDefinition skipParam = installGoal.getParameter("skip"); + assertTrue(skipParam.isCacheKey()); + } + + @Test + void testDefaultReconciliationParametersAreValid() { + PluginParameterLoader loader = new PluginParameterLoader(); + + // Verify that default reconciliation parameters for maven-compiler-plugin are valid + PluginParameterDefinition compilerDef = loader.load("maven-compiler-plugin"); Review Comment: compilerDefinition ########## src/test/java/org/apache/maven/buildcache/xml/PluginParameterValidationTest.java: ########## @@ -0,0 +1,185 @@ +/* + * 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.buildcache.xml; + +import org.apache.maven.buildcache.xml.PluginParameterDefinition.GoalParameterDefinition; +import org.apache.maven.buildcache.xml.PluginParameterDefinition.ParameterDefinition; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests for plugin parameter definition loading and validation system + */ +class PluginParameterValidationTest { + + @Test + void testLoadMavenCompilerPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); + + assertNotNull(def, "Should load maven-compiler-plugin definition"); + assertEquals("org.apache.maven.plugins", def.getGroupId()); + assertEquals("maven-compiler-plugin", def.getArtifactId()); + + // Verify compile goal exists + GoalParameterDefinition compileGoal = def.getGoal("compile"); + assertNotNull(compileGoal, "compile goal should exist"); + + // Verify cache-key parameters + assertTrue(compileGoal.hasParameter("source"), "Should have 'source' parameter"); + assertTrue(compileGoal.hasParameter("target"), "Should have 'target' parameter"); + assertTrue(compileGoal.hasParameter("release"), "Should have 'release' parameter"); + + ParameterDefinition sourceParam = compileGoal.getParameter("source"); + assertTrue(sourceParam.isCacheKey()); + + // Parameters without cache-key metadata default to false + assertTrue(compileGoal.hasParameter("verbose"), "Should have 'verbose' parameter"); + ParameterDefinition verboseParam = compileGoal.getParameter("verbose"); + assertTrue(!verboseParam.isCacheKey()); + } + + @Test + void testLoadMavenInstallPlugin() { + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-install-plugin"); + + assertNotNull(def, "Should load maven-install-plugin definition"); Review Comment: probably don't need this assert; if it fails the next assert fails too ########## src/test/java/org/apache/maven/buildcache/xml/AutoTrackingCacheKeyParametersTest.java: ########## @@ -0,0 +1,144 @@ +/* + * 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.buildcache.xml; + +import java.util.Set; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests that auto-tracking from plugin parameter definitions works correctly. + * Verifies that all cache-key parameters are automatically tracked, not just a subset. + */ +class AutoTrackingCacheKeyParametersTest { + + @Test + void testMavenCompilerPluginAutoTracksAllCacheKeyParameters() { + // This test verifies that the auto-generation tracks ALL cache-key parameters, + // not just the 3 that were in the old defaults.xml (source, target, release) + + PluginParameterLoader loader = new PluginParameterLoader(); + PluginParameterDefinition def = loader.load("maven-compiler-plugin"); + + assertNotNull(def, "Should load maven-compiler-plugin definition"); + + PluginParameterDefinition.GoalParameterDefinition compileGoal = def.getGoal("compile"); + assertNotNull(compileGoal, "compile goal should exist"); + + // Get all cache-key parameter names from the XML definition + Set<String> cacheKeyParams = compileGoal.getParameters().values().stream() + .filter(PluginParameterDefinition.ParameterDefinition::isCacheKey) + .map(PluginParameterDefinition.ParameterDefinition::getName) + .collect(Collectors.toSet()); + + // Verify we have more than just the original 3 from defaults.xml + assertTrue( + cacheKeyParams.size() > 3, + "Should have more than 3 cache-key parameters (was: " + cacheKeyParams.size() + ")"); + + // Verify the original 3 are included + assertTrue(cacheKeyParams.contains("source"), "Should include 'source' parameter"); + assertTrue(cacheKeyParams.contains("target"), "Should include 'target' parameter"); + assertTrue(cacheKeyParams.contains("release"), "Should include 'release' parameter"); + + // Verify additional cache-key parameters are included (these were NOT in defaults.xml) + assertTrue( + cacheKeyParams.contains("encoding"), + "Should include 'encoding' parameter (auto-tracked, not in old defaults.xml)"); + assertTrue( + cacheKeyParams.contains("debug"), + "Should include 'debug' parameter (auto-tracked, not in old defaults.xml)"); + assertTrue( + cacheKeyParams.contains("compilerArgs"), + "Should include 'compilerArgs' parameter (auto-tracked, not in old defaults.xml)"); + assertTrue( + cacheKeyParams.contains("annotationProcessorPaths"), + "Should include 'annotationProcessorPaths' parameter (auto-tracked, not in old defaults.xml)"); + for (String paramName : new String[] { + "showWarnings", + "showDeprecation", + "fork", + "maxmem", + "meminitial", + "failOnError", + "failOnWarning", + "forceJavacCompilerUse", + "staleMillis", + "useIncrementalCompilation" + }) { + assertTrue( + cacheKeyParams.contains(paramName), + "Should include '" + paramName + "' because changing it can cause a cache miss"); + } + } + + @Test + void testMavenInstallPluginAutoTracksAllCacheKeyParameters() { + PluginParameterLoader loader = new PluginParameterLoader(); Review Comment: This is repeated a lot. It could probably be done in setUP -- 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]
