Warm tip: This article is reproduced from serverfault.com, please click

proxy repository is blocked

发布于 2015-12-17 04:49:08

I added a proxy repository in nexus. When I update now in Routing, it failed. The repo url I added is https://raw.githubusercontent.com/dianping/cat/mvn-repo enter image description here

enter image description here

I can access this url

https://raw.githubusercontent.com/dianping/cat/mvn-repo/org/unidal/maven/plugins/codegen/2.3.2/codegen-2.3.2.pom

I can't access this url

https://raw.githubusercontent.com/dianping/cat/mvn-repo

response 400: Invalid request


So. It's the repo server block nexus from update.

If I don't use mirror in maven setting, Maven update will work right.

Meanwhile, when I use nexus public repositores group as my mirror(I also added proxy repo to public repositories group), It just report Failure to find org.unidal.maven.plugins:codegen-maven-plugin:jar:2.3.2 in http://172.xxx/nexus/content/groups/public

How can I solve this problem?

And I guess the maven resolve flow is like:

  1. maven resolve a dependency
  2. find the dependency in local
  3. find in repo manager
  4. find in proxy repo.

As the full url like https://raw.githubusercontent.com/dianping/cat/mvn-repo/org/unidal/maven/plugins/codegen/2.3.2/codegen-2.3.2.pom can be access, repo manager could fetch the specific pom url, if my guess is right.

I wonder: Unlike maven central,which you can access its index or called file tree, this cat.repo you can only access its file but not its directory. So what's the diffenrence in maven? How to handle this?


EDIT

Because I've successed update not using <mirrorOf>*</mirrorOf>. My local repository already download these missing plugins in Nexus. So I follow the tips in Maven not using the local repo, and that missing plugin does not cause error again, but another artifact not found in nexus again.

I also do as maven missing artifact shows, by

Deleting maven-metadata*.xml and _*.repositories inside local

Still not working.

Questioner
Aylwyn Lake
Viewed
0
rseddon 2015-12-17 22:11:20

The remote is returning HTTP code 400 (invalid request) for request to "/".

Nexus does HEAD and GET requests to the root URL to determine if the remote is reachable, and in good health. This response code is causing Nexus to think the remote is not working.

To work around this, go to the proxy repository's configuration tab and set "auto-blocking enabled" to "false".