开发者

How do I deal with a missing remote resource in my maven build due to CHECKSUM FAILED

开发者 https://www.devze.com 2023-03-16 12:09 出处:网络
I\'ve noticed that a m开发者_高级运维aven build is failing because a particular dependancy cannot be downloaded. In the build log I get a lot of error messages like this:

I've noticed that a m开发者_高级运维aven build is failing because a particular dependancy cannot be downloaded. In the build log I get a lot of error messages like this:

WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '10c2aa7dfc8577cb32ee654d2cd5b270d478b823'; remote = '<!DOCTYPE' - RETRYING
Downloading: http://maven.glassfish.org/content/groups/public//org/apache/maven/maven-archiver/2.0.1/maven-archiver-2.0.1.pom

If I inspect the URL it's trying to fetch from, I can see that this resource does ineed seem to be broken. I guess this is what passes for a 404 in Oracle-Land. The odd thing is that if I look at the parent directory I can see an entry for that missing file, but with no file-size.

Clearly something is wrong in the remote server. That's causing all my downloaded artifacts to contain a load of HTML junk. Deleting the files and re-running just causes the exact same set of garbage to be downloaded from Oracle.

The question is - how can I work around this problem? Unfortunately this is a new project that I've just dredged up from the murky mists of time. None of my colleagues have the components on their PCs, otherwise I'd just copy from them. Can I instruct maven to use some alternative source to obtain the missing jars?


You could probably try one of these three options:

Remove the offending repository declaration if you can edit the POM it is defined in. This will solve the problem for everyone who needs to develop on the project.

Override the repository specific repository URL in your settings.xml. You will need to find which POM the repository is defined in and note its name. You can the use something like:

<mirror>
  <id>temporary-override</id>
  <url>http://repo1.maven.org/maven2/</url>
  <mirrorOf>ID_OF_REPO</mirrorOf>
</mirror>

If all else fails override all repositories:

<mirror>
  <id>temporary-override</id>
  <url>http://repo1.maven.org/maven2/</url>
  <mirrorOf>*</mirrorOf>
</mirror>

The Maven site has some documentation about repository mirrors.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号