Do you know the Maven profile for mvnrepository.com?
Solution 1
Once you've found your jar through mvnrepository.com, hover the "download (JAR)" link, and you'll see the link to the repository which contains your jar (you can probably Right clic and "Copy link URL" to get the URL, what ever your browser is).
Then, you have to add this repository to the repositories used by your project, in your pom.xml :
<project>
...
<repositories>
<repository>
<id>my-alternate-repository</id>
<url>http://myrepo.net/repo</url>
</repository>
</repositories>
...
</project>
EDIT : now MVNrepository.com has evolved : You can find the link to the repository in the "Repositories" section :
License
Categories
HomePage
Date
Files
Repositories
Solution 2
mvnrepository.com isn't a repository. It's a search engine. It might or might not tell you what repository it found stuff in if it's not central; since you didn't post an example, I can't help you read the output.
Solution 3
You can put this configuration in your settings.xml file:
<repository>
<id>mvnrepository</id>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
Solution 4
Please use this profile
<profiles>
<profile>
<repositories>
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>http://www.mvnrepository.com</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>mvnrepository</activeProfile>
</activeProfiles>
user786045
Updated on September 21, 2020Comments
-
user786045 over 3 years
I am trying to include some dependencies in my Maven project. These dependencies are not available in the default Maven 2 repository http://repo1.maven.org/maven2/.
They are available at http://mvnrepository.com/.
But I couldn't find the profile for this site to include in my
settings.xml
.Does anyone know what this repository's URL and profile is?
-
carlspring almost 13 yearsI will counter the part where "it might or might not tell you what repository it found stuff in". It works with Maven Central. Otherwise, yes, this isn't an actual Maven Repository, but just a search engine for dependencies.
-
user786045 almost 13 yearsI was looking for this: <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4</version> </dependency> but could not find it in repo1.maven.org
-
Artem almost 13 yearsThat one is 'special'. Better to use Geronimo. But if you must, it happens to live at java.net.
-
Artem almost 13 years@carl it looks at more than maven central, and the answer above shows that it does reveal where it found any given thing.
-
man910 over 9 yearsThis is central, not mvn.
-
James Oravec over 8 yearsThis is a great answer, you may also want to include the
snapshots
andreleases
options shown below by Nicolas. -
Ced almost 8 yearsThere is no download jar link
-
DaveM almost 8 yearsJust to note that if you search for the details on search.maven.org or mvnrepository.com when you find the project you want you should see the projects pom.xml, open this and then search for url, eventually you will likely see a tag <distributionManagement><repository> that has the URL details within it. You can then navigate to this url in your browser, and see if you can find the required jar files etc. Otherwise, search on the other URLs that are picked up
-
DarthPablo over 7 yearsI wouldn't profess to be a Maven expert, but why do other answers say that mvnrepository isn't a repository when this works? (Even if it's a "proxy" for other repositories)
-
zhrist about 7 yearsYou can add this repositories to your active profile in settings.xml , if you want to go global on the whole m2 repo. Most of this repositories are used in most of the projects, so to add them individually to every pom is too much.
-
Renato Back over 6 yearsThis answer would be more appropriate as a comment.
-
Artem over 6 yearsThat comment would be more appropriate six years ago.
-
html_programmer over 5 yearsDoesn't work for me. It needs an id on the profile, then I need to link the profile in activeProfiles instead of the repository?
-
Premlatha over 4 yearsPlease explain your answer.
-
julian-alarcon over 2 yearsmvnrepository its the not the official one, the official is search.maven.org/ As mentioned here: central.sonatype.org/search