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

我对maven也有同样的麻烦。我通过将镜像添加到 maven 设置.xml 文件来解决这个问题

这是镜子 http://docs.codehaus.org/display/MAVENUSER/Mirrors+Repositories

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

当 Maven 获取依赖项和父项目时,它会抛出一个Permission denied: connect错误。
我发现该问题可能与JDK 1.7和Windows 7中的已知错误有关。问题出在应用程序不完全支持 IPv6 或网络/防火墙不完全支持 IPv6 上。解决方法是在 Java 或 Maven 命令行参数中设置-Djava.net.preferIPv4Stack=true

这很明显:"权限被拒绝"。就是这样。您正在使用的存储库(其中一个)需要您在访问之前进行身份验证和授权。如果您真的无法访问或将您的登录名/密码(例如像这样放入您的settings.xml文件中),您应该停止使用此存储库,以便 Maven 可以向您介绍服务器:)。

最新更新