简体   繁体   English

Nexus不会从中央存储库下载完整的工件内容

[英]Nexus doesn't download the complete artifact content from the Central repository

In our project we use the artifact 在我们的项目中,我们使用工件

<dependency>
  <groupId>nl.jqno.equalsverifier</groupId>
  <artifactId>equalsverifier</artifactId>
  <version>1.7.5</version>
</dependency>

Everything works fine: Nexus downloads the same content as in http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/1.7.5/ to its proxy repository. 一切正常:Nexus将与http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/1.7.5/相同的内容下载到其代理存储库。 ('Download' column in artifact details on Nexus shows 'pom, jar') (Nexus上工件详情中的“下载”列显示“ pom,jar”)

Now, we switch to the newest version 2.0.2 of the artifact: 现在,我们切换到工件的最新版本2.0.2:

<dependency>
  <groupId>nl.jqno.equalsverifier</groupId>
  <artifactId>equalsverifier</artifactId>
  <version>2.0.2</version>
</dependency>

Then, when we try to build the project then the attempt fails. 然后,当我们尝试构建项目时,尝试将失败。 Nexus cannot resolve the artifact! Nexus无法解决问题! It seems like Nexus didn't download the complete content of the artifact version ('Download' column in artifact details on Nexus shows 'pom, pom'). Nexus似乎未下载工件版本的完整内容(Nexus工件细节中的“下载”列显示为“ pom,pom”)。 On the other site, when I look at the artifact in the Central repository, the content is as usual: http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/2.0.2/ . 在另一个站点上,当我查看中央存储库中的工件时,内容照常: http : //repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/2.0.2/

What causes the problem with the newest artifact version? 是什么导致最新工件版本出现问题? Why can't Nexus download it correctly? Nexus为什么无法正确下载?

You may have overlooked that your dependency is of type pom. 您可能忽略了您的依赖项为pom类型。 This will only download the pom, because that's what you are asking for. 这只会下载pom,因为这就是您要的内容。 Remove the <type> and you should get the jar aswell. 删除<type> ,您也应该得到jar。

<dependency>
  <groupId>nl.jqno.equalsverifier</groupId>
  <artifactId>equalsverifier</artifactId>
  <version>2.0.2</version>
  <type>pom</type> <-------------- Remove this
</dependency>

Assuming crea1's answer didn't solve your problem: 假设crea1的答案不能解决您的问题:

Maybe something went wrong when Maven downloaded the artifact, causing Maven to "think" the artifact was downloaded anyway. 当Maven下载工件时,可能出了些问题,导致Maven仍然认为工件被下载了。

You can force Maven to try and download it again with mvn -U test . 您可以强制maven尝试使用mvn -U test再次下载它。

If that doesn't work, try going into ~/.m2/repository (or wherever Maven stores its artifacts locally on your system), locating EqualsVerifier, removing the entire 2.0.2 folder, and calling Maven again. 如果这不起作用,请尝试进入~/.m2/repository (或Maven在系统上本地存储其工件的任何位置),找到EqualsVerifier,删除整个2.0.2文件夹,然后再次调用Maven。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM