This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/maven-build-cache-extension.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b862ca  Test-jar type dependencies fail to be resolved during 
checksum calculation with -f builds (#468)
8b862ca is described below

commit 8b862ca42cba2d8a7c833e86d21234e4ff166ad9
Author: Olivier Lamy <[email protected]>
AuthorDate: Tue Mar 24 07:32:22 2026 +1000

    Test-jar type dependencies fail to be resolved during checksum calculation 
with -f builds (#468)
    
    Signed-off-by: Olivier Lamy <[email protected]>
---
 .../buildcache/checksum/MavenProjectInput.java     |  14 ++-
 .../its/projecttypes/SingleModuleTestJarTest.java  | 108 +++++++++++++++++++++
 .../p20-single-module-testjar/.mvn/extensions.xml  |  26 +++++
 .../.mvn/maven-build-cache-config.xml              |  28 ++++++
 .../module-consumer/pom.xml                        |  47 +++++++++
 .../caching/test/p20/consumer/ConsumerApp.java     |  31 ++++++
 .../caching/test/p20/consumer/ConsumerTest.java    |  31 ++++++
 .../module-producer/pom.xml                        |  49 ++++++++++
 .../caching/test/p20/producer/ProducerLib.java     |  29 ++++++
 .../caching/test/p20/producer/TestHelper.java      |  29 ++++++
 .../p20-single-module-testjar/pom.xml              |  39 ++++++++
 .../p20-single-module-testjar/readme.md            |  31 ++++++
 12 files changed, 460 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java 
b/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java
index 4f05eb3..8f31237 100644
--- a/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java
+++ b/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java
@@ -836,11 +836,21 @@ private DigestItem resolveArtifact(final Dependency 
dependency)
             return DtoUtils.createDigestedFile(artifact, hash);
         }
 
+        // Handle special dependency types that have implicit classifiers
+        String classifier = dependency.getClassifier();
+        String extension = null;
+
+        // test-jar type requires "tests" classifier and "jar" extension
+        if ("test-jar".equals(dependency.getType()) && (classifier == null || 
classifier.isEmpty())) {
+            classifier = "tests";
+            extension = "jar";
+        }
+
         org.eclipse.aether.artifact.Artifact dependencyArtifact = new 
org.eclipse.aether.artifact.DefaultArtifact(
                 dependency.getGroupId(),
                 dependency.getArtifactId(),
-                dependency.getClassifier(),
-                null,
+                classifier,
+                extension,
                 dependency.getVersion(),
                 new DefaultArtifactType(dependency.getType()));
         ArtifactRequest artifactRequest = new 
ArtifactRequest().setArtifact(dependencyArtifact);
diff --git 
a/src/test/java/org/apache/maven/buildcache/its/projecttypes/SingleModuleTestJarTest.java
 
b/src/test/java/org/apache/maven/buildcache/its/projecttypes/SingleModuleTestJarTest.java
new file mode 100644
index 0000000..2316b2a
--- /dev/null
+++ 
b/src/test/java/org/apache/maven/buildcache/its/projecttypes/SingleModuleTestJarTest.java
@@ -0,0 +1,108 @@
+/*
+ * 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.its.projecttypes;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.apache.maven.buildcache.its.CacheITUtils;
+import org.apache.maven.buildcache.its.MavenSetup;
+import org.apache.maven.buildcache.its.ReferenceProjectBootstrap;
+import org.apache.maven.it.Verifier;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.ResourceLock;
+import org.junit.jupiter.api.parallel.Resources;
+
+/**
+ * Verifies that single module builds with {@code mvn -f <submodule>} work 
correctly when the
+ * submodule depends on test-jar artifacts from other modules (reproduces 
issue #467).
+ *
+ * <p>The issue occurs when building a single module that depends on a 
test-jar artifact:
+ * the build cache extension fails to resolve the test-jar dependency from the 
local repository
+ * because {@code session.getAllProjects()} only contains the single module 
being built.
+ *
+ * <p>Uses P20 ({@code p20-single-module-testjar}) which includes:
+ * - {@code module-producer}: produces both regular jar and test-jar
+ * - {@code module-consumer}: depends on test-jar from producer
+ *
+ * <p>Test sequence:
+ * 1. Full reactor build to populate local repository and cache
+ * 2. Single module build of consumer (should succeed with fixed resolution 
logic)
+ */
+@Tag("smoke")
+@ResourceLock(Resources.SYSTEM_PROPERTIES)
+class SingleModuleTestJarTest {
+
+    @BeforeAll
+    static void setUpMaven() throws Exception {
+        MavenSetup.configureMavenHome();
+    }
+
+    @Test
+    void singleModuleBuildWithTestJarDependency() throws Exception {
+        Path p20 = 
Paths.get("src/test/projects/reference-test-projects/p20-single-module-testjar")
+                .toAbsolutePath();
+        Verifier verifier = ReferenceProjectBootstrap.prepareProject(p20, 
"SingleModuleTestJarTest");
+        verifier.setAutoclean(false);
+
+        // Build 1: Full reactor build to populate local repository and cache
+        // This should work (both modules built together)
+        verifier.setLogFileName("../log-full-reactor.txt");
+        verifier.executeGoal("install");
+        verifier.verifyErrorFreeLog();
+        verifier.verifyTextInLog(CacheITUtils.CACHE_SAVED);
+
+        // Build 2: Single module build of consumer (the critical test)
+        // Before fix: this would fail with ArtifactResolutionException for 
test-jar
+        // After fix: this should succeed by resolving test-jar from local 
repository
+        verifier.setLogFileName("../log-single-module.txt");
+        verifier.addCliOption("-f");
+        verifier.addCliOption("module-consumer");
+        verifier.executeGoal("install");
+        verifier.verifyErrorFreeLog();
+        // Should be able to resolve test-jar dependency and calculate 
checksums successfully
+        verifier.verifyTextInLog("Going to calculate checksum for project");
+    }
+
+    @Test
+    void singleModuleBuildWithCacheDisabledShouldWork() throws Exception {
+        Path p20 = 
Paths.get("src/test/projects/reference-test-projects/p20-single-module-testjar")
+                .toAbsolutePath();
+        Verifier verifier = ReferenceProjectBootstrap.prepareProject(p20, 
"SingleModuleTestJarTestDisabled");
+        verifier.setAutoclean(false);
+
+        // Build 1: Full reactor build to populate local repository
+        verifier.setLogFileName("../log-full-reactor-disabled.txt");
+        verifier.setSystemProperty("maven.build.cache.enabled", "false");
+        verifier.executeGoal("install");
+        verifier.verifyErrorFreeLog();
+        verifier.verifyTextInLog("Cache disabled by command line flag");
+
+        // Build 2: Single module build with cache disabled (control test - 
should always work)
+        verifier.setLogFileName("../log-single-module-disabled.txt");
+        verifier.addCliOption("-f");
+        verifier.addCliOption("module-consumer");
+        verifier.setSystemProperty("maven.build.cache.enabled", "false");
+        verifier.executeGoal("install");
+        verifier.verifyErrorFreeLog();
+        verifier.verifyTextInLog("Cache is DISABLED on project level");
+    }
+}
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/.mvn/extensions.xml
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/.mvn/extensions.xml
new file mode 100644
index 0000000..d28f29c
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/.mvn/extensions.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<extensions>
+    <extension>
+        <groupId>org.apache.maven.extensions</groupId>
+        <artifactId>maven-build-cache-extension</artifactId>
+        <version>${projectVersion}</version>
+    </extension>
+</extensions>
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/.mvn/maven-build-cache-config.xml
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/.mvn/maven-build-cache-config.xml
new file mode 100644
index 0000000..6f9399c
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/.mvn/maven-build-cache-config.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+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.
+-->
+<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.2.0
+           https://maven.apache.org/xsd/build-cache-config-1.2.0.xsd";>
+    <configuration>
+        <enabled>true</enabled>
+        <hashAlgorithm>XX</hashAlgorithm>
+    </configuration>
+</cache>
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/pom.xml
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/pom.xml
new file mode 100644
index 0000000..83c9ca7
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.caching.test.p20</groupId>
+    <artifactId>p20-single-module-testjar</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>module-consumer</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.caching.test.p20</groupId>
+      <artifactId>module-producer</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.caching.test.p20</groupId>
+      <artifactId>module-producer</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+      <type>test-jar</type>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/src/main/java/org/apache/maven/caching/test/p20/consumer/ConsumerApp.java
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/src/main/java/org/apache/maven/caching/test/p20/consumer/ConsumerApp.java
new file mode 100644
index 0000000..8276886
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/src/main/java/org/apache/maven/caching/test/p20/consumer/ConsumerApp.java
@@ -0,0 +1,31 @@
+/*
+ * 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.caching.test.p20.consumer;
+
+import org.apache.maven.caching.test.p20.producer.ProducerLib;
+
+/**
+ * P20 module-consumer: main app using producer lib.
+ */
+public class ConsumerApp {
+
+    public static void main(String[] args) {
+        System.out.println(ProducerLib.greeting());
+    }
+}
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/src/test/java/org/apache/maven/caching/test/p20/consumer/ConsumerTest.java
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/src/test/java/org/apache/maven/caching/test/p20/consumer/ConsumerTest.java
new file mode 100644
index 0000000..b5aaddc
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-consumer/src/test/java/org/apache/maven/caching/test/p20/consumer/ConsumerTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.caching.test.p20.consumer;
+
+import org.apache.maven.caching.test.p20.producer.TestHelper;
+
+/**
+ * P20 module-consumer: test class that uses test-jar dependency from producer.
+ */
+public class ConsumerTest {
+
+    public static void main(String[] args) {
+        System.out.println(TestHelper.testGreeting());
+    }
+}
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/pom.xml
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/pom.xml
new file mode 100644
index 0000000..b48123e
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.caching.test.p20</groupId>
+    <artifactId>p20-single-module-testjar</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>module-producer</artifactId>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>3.4.2</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/src/main/java/org/apache/maven/caching/test/p20/producer/ProducerLib.java
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/src/main/java/org/apache/maven/caching/test/p20/producer/ProducerLib.java
new file mode 100644
index 0000000..b8f10dc
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/src/main/java/org/apache/maven/caching/test/p20/producer/ProducerLib.java
@@ -0,0 +1,29 @@
+/*
+ * 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.caching.test.p20.producer;
+
+/**
+ * P20 module-producer: main library class.
+ */
+public class ProducerLib {
+
+    public static String greeting() {
+        return "Hello from producer lib";
+    }
+}
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/src/test/java/org/apache/maven/caching/test/p20/producer/TestHelper.java
 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/src/test/java/org/apache/maven/caching/test/p20/producer/TestHelper.java
new file mode 100644
index 0000000..93829c3
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/module-producer/src/test/java/org/apache/maven/caching/test/p20/producer/TestHelper.java
@@ -0,0 +1,29 @@
+/*
+ * 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.caching.test.p20.producer;
+
+/**
+ * P20 module-producer: test helper class exported via test-jar for reuse in 
other modules' tests.
+ */
+public class TestHelper {
+
+    public static String testGreeting() {
+        return "Hello from producer test helper";
+    }
+}
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/pom.xml 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/pom.xml
new file mode 100644
index 0000000..6e6e5ca
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.caching.test.p20</groupId>
+  <artifactId>p20-single-module-testjar</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>module-producer</module>
+    <module>module-consumer</module>
+  </modules>
+
+  <properties>
+    <maven.compiler.release>17</maven.compiler.release>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+</project>
\ No newline at end of file
diff --git 
a/src/test/projects/reference-test-projects/p20-single-module-testjar/readme.md 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/readme.md
new file mode 100644
index 0000000..053748c
--- /dev/null
+++ 
b/src/test/projects/reference-test-projects/p20-single-module-testjar/readme.md
@@ -0,0 +1,31 @@
+# P20: Single Module Test-jar Dependencies
+
+P20 tests building a single module with `mvn -f <submodule>` when that module 
depends on a test-jar artifact from another module.
+
+## Project Structure
+
+```
+p20-single-module-testjar/
+  ├── module-producer/  (produces test-jar artifact)
+  └── module-consumer/  (depends on test-jar from producer)
+```
+
+## Test Scenario
+
+- `module-producer`: produces both regular jar and test-jar
+- `module-consumer`: depends on both regular jar and test-jar from producer
+
+## Key Test Case
+
+The critical test is: **Can `mvn -f module-consumer clean install` succeed 
when the build cache extension is enabled?**
+
+- Full reactor builds (`mvn clean install`) should always work
+- Single module builds (`mvn -f module-consumer clean install`) failed in 
issue #467 due to test-jar resolution problems
+- The build cache extension could not resolve test-jar dependencies even when 
they existed in local repository
+
+## Resolution Testing
+
+This project validates that the build cache extension can properly:
+1. Resolve test-jar dependencies from local repository in single module builds
+2. Calculate checksums for projects with test-jar dependencies
+3. Handle the case where `session.getAllProjects()` only contains the single 
module being built
\ No newline at end of file

Reply via email to