gnodet commented on code in PR #12680:
URL: https://github.com/apache/maven/pull/12680#discussion_r3917869744


##########
impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java:
##########
@@ -146,6 +160,38 @@ public void resolveProjectDependencies(
                 File reactorProjectFile = reactorProjects.get(artifact);
                 if (reactorProjectFile != null) {
                     artifact.setFile(reactorProjectFile);
+                } else if (artifact.getFile() == null) {
+                    // Fallback: try matching reactor projects by GAV (handles 
type/classifier
+                    // mismatches) or look up the artifact in the local 
repository.
+                    String gavKey = ArtifactUtils.key(artifact);
+                    MavenProject reactorProject = reactorGavMap.get(gavKey);
+                    if (reactorProject != null) {
+                        File fallback = reactorProject.getArtifact().getFile();
+                        if (fallback == null) {

Review Comment:
   **Low:** This output-directory fallback block duplicates the identical logic 
at lines 139-145 above. Consider extracting a shared helper (e.g. 
`resolveReactorProjectFile(MavenProject)`) to avoid maintaining two copies.
   
   Also note: `ArtifactUtils.key()` produces `groupId:artifactId:version` only 
— a tests-jar dependency (`classifier="tests"`) would match the main project 
and receive `target/classes` instead of `target/test-classes`. Worth 
documenting as a known limitation in the "handles type/classifier mismatches" 
comment above.



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