repository node configuration in pom not working

repository node configuration in pom not working

Today, the maven build encountered a problem. The repository is configured in pom.xml. As a result, the jar package required during the running process is not downloaded here. It is obviously added, and it can be found directly by clicking it. I found the reason, it turned out to be the reason why maven's setting.xml file is configured with mirror.

<mirror>
    <id>ibiblio</id>
    <mirrorOf>*</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>

The error is in the mirrorOf node. If you write *, it will overwrite everything, no matter which repository it is, it will be mirrored by this mirror in the end, causing the repository in the pom file to not take effect. The solution is also very simple, just change this mirrorOf. For specific modifications, please refer to the official maven instructions:

* = everything
external:* = everything not on the localhost and not file based
repo,repo1 = repo or repo1
*,!repo1 = everything except repo1

In-depth comparison of the priorities of several maven repositories

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325527830&siteId=291194637