github / maven-plugins

Official GitHub Maven Plugins
MIT License
584 stars 198 forks source link

Pull Repository Info From SCM URL #11

Closed JakeWharton closed 12 years ago

JakeWharton commented 12 years ago

It seems the plugin pulls repository info from the POM's general <url> tag which often is not a link to a project repository. Instead use the <url> tag in the <scm> tree.

<project>
    <url>http://example.com/awesome</url>
    <scm>
        <url>http://github.com/example/awesome</url>
    </scm>
</project>
kevinsawicki commented 12 years ago

It tries to parse it from multiple sources in this order:

You can also explicitly configure it using two separate configuration values, repositoryName and repositoryOwner.

JakeWharton commented 12 years ago

Ah, makes sense. I had an extreme edge case where both the url and the scm.url were both defined to point to GitHub repos but only the scm.url was my project. Probably not something the average user would run in to. Nor did I bother digging in the code as it was getting late.

Thanks for the explanation.

kevinsawicki commented 12 years ago

You bring up a good point though, I think the heuristics should check the project.url last and not first since the scm elements are much more likely to always be GitHub URLs.

kevinsawicki commented 12 years ago

This has been released in version 0.6 of the site plugin and version 0.5 of the downloads plugin and is available from Maven Central.