Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix project and scm url in pom.xml #118

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Fix project and scm url in pom.xml #118

merged 1 commit into from
Apr 12, 2022

Conversation

lucifer4j
Copy link
Contributor

@lucifer4j lucifer4j commented Mar 2, 2022

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.

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, for instance https://github.com/quarkusio/quarkus/bom/quarkus-bom
 end up in 404s. Similarly, the scm urls are broken. The right behaviour
 would most likely be to point to just https://github.com/quarkusio/quarkus/.

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.
pom.xml Show resolved Hide resolved
@dmlloyd dmlloyd merged commit 3252658 into jboss:main Apr 12, 2022
@lucifer4j
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants