Skip to content

[MSITE-1033] AbstractDeployMojo.getTopLevelProject(Project) returns wrong project for SCM URLs #1159

Open
@jira-importer

Description

@jira-importer

Konrad Windszus opened MSITE-1033 and commented

The method getTopLevelProject(project) (

protected MavenProject getTopLevelProject(MavenProject project) throws MojoExecutionException {
) returns the wrong project when all projects in the hierarchy have a "DistributionManagement->Site->URL" leveraging the SCM URL format: https://maven.apache.org/scm/scm-url-format.html (e.g. scm:git:git@github.com:codehaus-plexus/plexus-sec-dispatcher.git/). The method internally relies on https://github.com/apache/maven-doxia-sitetools/blob/9af3a745919525481e96bb4f0c18d62cf41446b4/doxia-site-model/src/main/java/org/apache/maven/doxia/site/inheritance/URIPathDescriptor.java#L191 which returns

true if ... shares the same scheme, host and port with the given URI.

For example https://github.com/codehaus-plexus/plexus-sec-dispatcher/blob/master/pom.xml inherits from https://github.com/codehaus-plexus/plexus-pom/blob/master/pom.xml but for sure both projects don't share a common site. However the latter is returned as top project as

scm:git:https://github.com/codehaus-plexus/plexus-pom.git/ and scm:git:git@github.com:codehaus-plexus/plexus-sec-dispatcher.git/ are incorrectly assumed to be the same because this URI is being parsed as

  1. host = null
  2. scheme = "scm"
  3. port = -1

(this is an opaque URI according to https://docs.oracle.com/javase/8/docs/api/java/net/URI.html#isOpaque--)


Issue Links:

  • MSITE-600 site plugin 3.0 does not permit a child to fully override parent site deployment URL

  • MSITE-1032 AbstractDeployMojo.getDeployModuleDirectory() does not work for Git SCM URLs

Remote Links:

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:majorMajor loss of function

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions