0

We have a problem at our project, where the pom file of the downloaded jar is not correct. It does not contain a 1.0 tag. So what we did was installing our "corrected" pom file for that library and added is a 3rd party library to nexus.

The problem we are now facing is that it does not take the version that we added as a 3rd party library. In a similar case, when we deleted the file out of the maven central nexus repository, than it took the 3rd party library, and it did not try to fetch it again from maven central.

Now we did the same for a corrupted jar, but when we delete the jar in the openSAML nexus repository, instead of using the 3rd party library, it refetches it from the openSAML nexus repository and it does not take ours.

Does anyone have an idea to why it refetches it and does not take the 3rd party library?

4

1 回答 1

0

尝试这个。从本地存储库中删除 jar。现在转到 Maven 设置并暂时删除 openSAML 存储库的条目。现在构建您的项目,它现在将从 3rd 方 nexus 存储库下载 jar [请注意,如果 3rd 存储库没有所有依赖项,则项目可能无法构建。下载新 jar 后,现在将 openSAML 条目放回 maven 设置。

编辑:

如果上述选项不可行,那么您可以设置存储库的顺序,使其首先检查第 3 方存储库,然后检查其他存储库。这意味着只有当 jar 在 3rd 方中不可用时,它才会转到其他存储库。现在,maven 检查存储库的顺序是它们在 settings.xml 中写入的顺序。查看这篇文章:How to set order of repositories in Maven settings.xml 这个解决方案是可扩展的,因为你可以简单地在团队中共享这个 settings.xml,你就完成了。

于 2013-10-10T14:45:13.427 回答