slachiewicz commented on PR #227: URL: https://github.com/apache/maven-site-plugin/pull/227#issuecomment-5338234945
The path check in this PR is the part that matters, and it is worth saying why, because a fix that only unwraps the SCM URL looks right and is not. Unwrapping alone turns `scm:git:https://github.com/org/parent.git` into a hierarchical URI, so `URIPathDescriptor.sameSite()` starts comparing it — and then reports two sibling repositories on one forge as the same site, since they share scheme, host and port. Requiring the child path to lie under the parent path, as this PR does, is what separates them. A test for that case is the one to have. Different hosts (`github.com` versus `gitlab.com`) pass either way: ```java MavenProject child = createProjectWithSite("child", "scm:git:https://github.com/codehaus-plexus/plexus-xml.git"); MavenProject parent = createProjectWithSite("parent", "scm:git:https://github.com/codehaus-plexus/plexus-pom.git"); child.setParent(parent); assertEquals(child, mojo.getTopLevelProject(child)); ``` The effect downstream, on plexus-pom 27 with site plugin 3.22.0: `mvn -Preporting verify site site:stage` in plexus-xml, a single-module project, stages into `target/staging/../plexus-xml.git` and leaves `target/staging` empty. With the fix, staging lands in `target/staging` with 216 files. That is codehaus-plexus/plexus-pom#333. This PR is conflicting against master. I have rebased an equivalent change and will open it as a separate PR so the fix is reviewable against current master — same approach as here, unwrap and then compare host plus path. Happy for whichever lands. *This comment was created with AI assistance.* -- 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]
