问题
There are web sites like http://mvnrepository.com/ letting to search for an "artifact" and giving a definition I can add to my project for a library to be downloaded automatically from a public repository.
But this particular example (mvnrepository.com) (the only working I know actually) is by-definition limited to "search by group, artifact or description" while I would like to search by a class full name. For example I'd like to enter org.apache.commons.lang.NotImplementedException
to get <dependency org="commons-lang" name="commons-lang" rev="2.6"/>
(or alike) as the answer. Is there a facility for this?
回答1:
The answer of @khmarbaise is straight and correct, but if you possibly want to search over few additional public Maven repos (like JBoss), not only Maven Central, I recommend using http://grepcode.com.
EDIT: Unfortunately it seems http://grepcode.com, I used to strongly recommend for such a stuff, is dead now. Currently I don't know a better place than https://search.maven.org, already answered by @khmarbaise.
回答2:
If you like to search for Classes you should use http://search.maven.org and click on "Advanced search"...This is for Maven Central
回答3:
I suggest to try all the search engines. Now I've lost hours thinking of how to upload an artifact, while it turned out to be already present in the repo. This is junit-addons
, which is both groupId and artifactId, as can be verified in pom. My attempts:
- http://mvnrepository.com - no
- http://search.maven.org - yes
- http://grepcode.com - no
- http://jarfinder.com - yes, but only a direct download, not for maven
I am a maven newbie, so I cannot state that the second link is the best. Although tt was the only helpful in my case.
来源:https://stackoverflow.com/questions/10056975/how-to-search-public-maven-ivy-repositories-for-a-particular-class