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 incorrect inherited URLs in pom.xml #2351

Conversation

Marcono1234
Copy link
Collaborator

Purpose

Fixes incorrect inherited URLs in the pom.xml, mainly in the one of the gson Maven module

Description

Previously Maven appended the artifact ID of the modules which lead for example for the gson module to the incorrect URL https://github.com/google/gson/gson (note the extra /gson at the end). This could be seen for example with mvn help:effective-pom:

...
 <url>https://github.com/google/gson/gson</url>
...
  <scm>
    <connection>scm:git:https://github.com/google/gson.git/gson</connection>
    <developerConnection>scm:git:git@github.com:google/gson.git/gson</developerConnection>
    <url>https://github.com/google/gson/gson/</url>
  </scm>
...

Other situations where this might have been visible are when using plugins to generate a summary of dependencies of a project and probably also the Sonatype Maven Central browser (see "Project URL" on the right).

This pull request uses the attributes described here to disable appending the artifact ID of the modules. With these changes the output of mvn help:effective-pom looks correct:

...
  <url>https://github.com/google/gson</url>
...
  <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
    <connection>scm:git:https://github.com/google/gson.git</connection>
    <developerConnection>scm:git:git@github.com:google/gson.git</developerConnection>
    <url>https://github.com/google/gson/</url>
  </scm>
...

See also the related Guava issue: google/guava#5618

Checklist

  • New code follows the Google Java Style Guide
  • If necessary, new public API validates arguments, for example rejects null
  • New public API has Javadoc
    • Javadoc uses @since $next-version$
      ($next-version$ is a special placeholder which is automatically replaced during release)
  • If necessary, new unit tests have been added
    • Assertions in unit tests use Truth, see existing tests
    • No JUnit 3 features are used (such as extending class TestCase)
    • If this pull request fixes a bug, a new test was added for a situation which failed previously and is now fixed
  • mvn clean verify javadoc:jar passes without errors

Previously Maven appended the artifact ID of the modules which lead for
example for the `gson` module to the incorrect URL https://github.com/google/gson/gson

This can be checked with `mvn help:effective-pom`
@eamonnmcmanus
Copy link
Member

Thanks!

@eamonnmcmanus eamonnmcmanus merged commit c34b9ff into google:master Mar 23, 2023
@Marcono1234 Marcono1234 deleted the marcono1234/fix-incorrect-inherited-pom-urls branch March 23, 2023 20:50
eamonnmcmanus pushed a commit that referenced this pull request May 31, 2023
Previously Maven appended the artifact ID of the modules which lead for
example for the `gson` module to the incorrect URL https://github.com/google/gson/gson

This can be checked with `mvn help:effective-pom`
tibor-universe pushed a commit to getuniverse/gson that referenced this pull request Sep 14, 2024
Previously Maven appended the artifact ID of the modules which lead for
example for the `gson` module to the incorrect URL https://github.com/google/gson/gson

This can be checked with `mvn help:effective-pom`
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