2

I am trying to create an ebuild for gentoo. The ebuild is supposed to download sources using this string

SRC_URI="http://search.maven.org/remotecontent?filepath=com/github/moaxcp/${PN}/${PN}/${PV}/${P}-sources.jar"

When I run the ebuild the url is translated to

http://search.maven.org/remotecontent?filepath=com/github/moaxcp/recMD5/recMD5/1.0.1/recMD5-1.0.1-sources.jar

The link is not correct and returns 404.

What is the standard for creating a link to an artifact in maven central?

John Mercier
  • 1,637
  • 3
  • 20
  • 44

1 Answers1

2

Link directly to the resource:

SRC_URI="https://repo1.maven.org/maven2/com/github/moaxcp/${PN}/${PV}/${P}-sources.jar"
guido
  • 18,864
  • 6
  • 70
  • 95
  • This did not work the variable resolved to http://search.maven.org/remotecontent?filepath=com/github/moaxcp/recMD5/recMD5/1.0.1/recMD5-1.0.1-sources.jar which is a 404. – John Mercier May 23 '15 at 00:38
  • I mean you should change the variable declaration in the ebuild file to the url above, instead of the one you are using. – guido May 23 '15 at 00:41
  • Note that the url will download the sources jar as repackaged during a build; id you want to build yourself, you should take the sources from their canonical repository, namely: https://github.com/moaxcp/recMD5/archive/recmd5-1.0.1.zip – guido May 23 '15 at 00:47
  • 1
    Sorry I pasted the wrong link. The ebuild resolves to this https://repo1.maven.org/maven2/com/github/moaxcp/recMD5/recMD5/1.0.1/recMD5-1.0.1-sources.jar which is a 404 – John Mercier May 23 '15 at 01:03
  • i see, you have a double ${PN} subdirectory in your original url as well; just need to remove it, see updated link – guido May 23 '15 at 01:04
  • Your link worked. It would be nice to use the github link but I ran into a problem with the case. ${P} is is recMD5-1.0.1 but I need recmd5-1.0.1 in the url. – John Mercier May 23 '15 at 01:11