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?
Maven local repository is located in your local system. It is created by the maven when you run any maven command. By default, maven local repository is %USER_HOME%/. m2 directory.
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. Follow this answer to receive notifications.
Downloading a jar from a Maven repository is not less safe than downloading a jar from another location. In other words, Maven repositories don't really introduce a problem, the problem is your dependency on an external library.
Maven provides a settings file, settings. xml, which allows us to specify which local and remote repositories it will use. We can also use it to store settings that we don't want in our source code, such as credentials.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With