简体   繁体   English

Maven不构建项目(连接问题)

[英]Maven not Building project (Connection Issue)

I am getting this error while trying to do a clean install using Maven: 尝试使用Maven进行全新安装时出现此错误:

[INFO] Scanning for projects...
Downloading: http://xxx/repository/com/fusionone/device/d
evice-parent/3.5.0-BA-CLIENT-SNAPSHOT/maven-metadata.xml
Downloading: http://xxx/repository/com/fusionone/device/device-pare
nt/3.5.0-BA-CLIENT-SNAPSHOT/maven-metadata.xml
Downloading: http://xxx/repository/com/fusionone/devic
e/device-parent/3.5.0-BA-CLIENT-SNAPSHOT/maven-metadata.xml
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: I/O exception (java.net.SocketException) caught when connecting to the tar
get host: Permission denied: connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
May 24, 2012 5:55:56 PM org.apache.maven.wagon.providers.http.httpclient.impl.cl
ient.DefaultRequestDirector tryConnect
INFO: Retrying connect
[WARNING] Could not transfer metadata com.xxx.device:device-parent:3.5.0-B
A-CLIENT-SNAPSHOT/maven-metadata.xml from/to maestro-project-server (http://xxx): Permission denied: connect
[WARNING] Could not transfer metadata com.xxx.device:device-parent:3.5.0-B
A-CLIENT-SNAPSHOT/maven-metadata.xml from/to xxx-xxx-repo (http://xxx): Permission denied: connect
[WARNING] Could not transfer metadata com.xxx.device:device-parent:3.5.0-B
A-CLIENT-SNAPSHOT/maven-metadata.xml from/to re-repo (http://xx.xx.x.xxx:xxx/re
pository): Permission denied: connect

I have the same trouble with maven. 我也遇到了Maven的麻烦。 I solve this by adding mirrors to maven setting.xml file 我通过向Maven setting.xml文件添加镜像来解决此问题

HERE are MIRRORS http://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories 这里是镜像http://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories

and documentation http://maven.apache.org/settings.html#Mirrors 和文档http://maven.apache.org/settings.html#Mirrors

When Maven fetches the dependencies and the parent projects, it throws a Permission denied: connect error. 当Maven获取依赖项和父项目时,它会抛出Permission denied: connect错误。
I have found that the issue may be related to a known bug in JDK 1.7 and Windows 7. The issue have either been with the application not fully supporting IPv6 or with a network/firewall that does not fully support IPv6. 我发现该问题可能与JDK 1.7和Windows 7中的一个已知错误有关。该问题可能与应用程序不完全支持IPv6或网络/防火墙不完全支持IPv6有关。 The workaround is to set -Djava.net.preferIPv4Stack=true in the Java or Maven command line arguments. 解决方法是在Java或Maven命令行参数中设置-Djava.net.preferIPv4Stack=true

That's pretty obvious: "Permission denied". 这很明显:“权限被拒绝”。 That's it. 而已。 Repository (one of them) you're using needs you to authenticate and authorize yourself before acccess. 您正在使用的存储库(其中之一)需要您在访问之前进行身份验证和授权。 You should stop using this repository if you really don't have access or put your login/password eg into your settings.xml file like this so Maven can introduce you to the server :). 你应该停止使用这个仓库,如果你真的没有访问或把你的登录/密码,如到您settings.xml像文件这样使Maven可以把你介绍给服务器:)。

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

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