Fix project and scm url in pom.xml #118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maven's default behaviour is to append path and artifact id to parent project url for setting child project's url. But this is not helpful because these urls end up in 404s. Similarly, the scm urls are broken. The right behaviour would most likely be to point to just project url.
For instance consider this Quarkus subproject which inherits from this JBoss Parent POM, https://github.com/quarkusio/quarkus/blob/main/independent-projects/tools/utilities/pom.xml. If you run,
mvn help:effective-pom
in this project, the project url will be resolved to http://www.jboss.org/quarkus-tools-parent/quarkus-devtools-utilities` which is wrong. (There is another issue that the particular independent project doesn't override the url but even with that the path will be wrong for child projects without specifying the attribute)Thankfully, Maven 3.6.1 introduced some attribute to set the child project's url to the project url of the parent without modifications. https://maven.apache.org/ref/3.8.4/maven-model/maven.html#:~:text=Description-,child.project.url.inherit.append.path,-String
Therefore, set the child.project.url.inherit.append.path project attribute and various scm attributes to ensure the correct urls are generated.
I have already opened quarkusio/quarkus#23928 for fixing the issue in Quarkus but maybe its better to fix it here because many other projects which require similar fixes would get covered automatically. However, there is a risk of breakage if someone actually wants this behaviour and since this is the parent pom for a wide number of projects the attribute may not be desired here.