Yasminette
Yasminette

Reputation: 1

Maven can't download a dependency

I have imported a project from GitHub as maven project. When I try to build, maven couldn't download a .jar. I tried to enter to the link of the jar and it seems to be impossible to download it, the server is too slow. I searched in pom files to change the link of the jar but not found !!! The project is constructed of a parent folder and 7 sub-projects

This is the link where maven tries to download http://maven.petalslink.com/others/net/sf/saxon/saxonhe/9.2.0.6/

I want to override it with this one for example https://maven.repository.redhat.com/nexus/content/groups/product-ga/net/sourceforge/saxon/saxonhe/9.2.1.5/

PS: it is my first time working with maven

Thank you

Upvotes: 0

Views: 917

Answers (2)

Jiri Tousek
Jiri Tousek

Reputation: 12440

If there's a repositories or distributionManagement section in your pom.xml, you can replace the slow repository URL with the one you want in the relevant repository element. Make sure though that the new repository contains all the artifacts that you needed to download from the original one.

Upvotes: 0

Yoav Gur
Yoav Gur

Reputation: 1386

To control where Maven downloads dependencies from, you should set the repositories part of Maven's settings.xml.

Upvotes: 2

Related Questions