Do you know the Maven profile for mvnrepository.com?

113,243

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>
Share:
113,243
user786045
Author by

user786045

Updated on September 21, 2020

Comments

  • user786045
    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
    carlspring almost 13 years
    I 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
    user786045 almost 13 years
    I 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
    Artem almost 13 years
    That one is 'special'. Better to use Geronimo. But if you must, it happens to live at java.net.
  • Artem
    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
    man910 over 9 years
    This is central, not mvn.
  • James Oravec
    James Oravec over 8 years
    This is a great answer, you may also want to include the snapshots and releases options shown below by Nicolas.
  • Ced
    Ced almost 8 years
    There is no download jar link
  • DaveM
    DaveM almost 8 years
    Just 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
    DarthPablo over 7 years
    I 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
    zhrist about 7 years
    You 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
    Renato Back over 6 years
    This answer would be more appropriate as a comment.
  • Artem
    Artem over 6 years
    That comment would be more appropriate six years ago.
  • html_programmer
    html_programmer over 5 years
    Doesn'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
    Premlatha over 4 years
    Please explain your answer.
  • julian-alarcon
    julian-alarcon over 2 years
    mvnrepository its the not the official one, the official is search.maven.org/ As mentioned here: central.sonatype.org/search