Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven无法从代理存储库下载工件?_Maven_Proxy_Windows Server 2012 - Fatal编程技术网

Maven无法从代理存储库下载工件?

Maven无法从代理存储库下载工件?,maven,proxy,windows-server-2012,Maven,Proxy,Windows Server 2012,项目的Maven构建在一个系统上失败,但在其他系统上失败 其他系统正确确定父pom位于此处: 失败的构建会查看每个代理存储库地址,但在正确的代理地址或任何其他代理服务器上都找不到它(请参见下面的错误输出) 这两个系统都使用相同的JDK和Maven版本,使用相同的settings.xml文件标识相应的代理存储库。它们具有与网络相同的物理连接,以及类似的防火墙等设置。没有第三方防病毒软件。关键区别在于,出现故障的系统运行的是Windows Server 2012,而不是Windows 7或8 是什

项目的Maven构建在一个系统上失败,但在其他系统上失败

其他系统正确确定父pom位于此处:

失败的构建会查看每个代理存储库地址,但在正确的代理地址或任何其他代理服务器上都找不到它(请参见下面的错误输出)

这两个系统都使用相同的JDK和Maven版本,使用相同的settings.xml文件标识相应的代理存储库。它们具有与网络相同的物理连接,以及类似的防火墙等设置。没有第三方防病毒软件。关键区别在于,出现故障的系统运行的是Windows Server 2012,而不是Windows 7或8

是什么导致这个单一构建失败? 如何确定POM无法从正确的URL下载的原因?(请注意,URL可从internet浏览器访问;POM可轻松手动下载。)

摘录自扩展的maven输出:

INFO] Scanning for projects...
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://(address)/nexus/content/groups/public
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://(address)/nexus/content/groups/public via proxy.company.org:80 with username=, password=***
Downloading: http://(address)/nexus/content/groups/public/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom

[DEBUG] Writing tracking file C:\m2repo\org\company\subgroup\subgroup-project\0.2.10\subgroup-project-0.2.10.pom.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://(address)/nexus/content/groups/external
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://(address)/nexus/content/groups/external via proxy.company.org:80 with username=, password=***
Downloading: http://(address)/nexus/content/groups/external/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom

[DEBUG] Writing tracking file C:\m2repo\org\company\subgroup\subgroup-project\0.2.10\subgroup-project-0.2.10.pom.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://(address)/nexus/content/groups/company-subgroup
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://(address)/nexus/content/groups/company-subgroup via proxy.company.org:80 with username=, password=***
Downloading: http://(address)/nexus/content/groups/company-subgroup/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom

[DEBUG] Writing tracking file C:\m2repo\org\company\subgroup\subgroup-project\0.2.10\subgroup-project-0.2.10.pom.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://(address)/nexus/content/groups/mirror
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://(address)/nexus/content/groups/mirror via proxy.company.org:80 with username=, password=***
Downloading: http://(address)/nexus/content/groups/mirror/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom

[DEBUG] Writing tracking file C:\m2repo\org\company\subgroup\subgroup-project\0.2.10\subgroup-project-0.2.10.pom.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://(address)/nexus/content/groups/proxied-repositories
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://(address)/nexus/content/groups/proxied-repositories via proxy.company.org:80 with username=, password=***
Downloading: http://(address)/nexus/content/groups/proxied-repositories/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom

[DEBUG] Writing tracking file C:\m2repo\org\company\subgroup\subgroup-project\0.2.10\subgroup-project-0.2.10.pom.lastUpdated
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://(address)/nexus/content/repositories/central
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://(address)/nexus/content/repositories/central via proxy.company.org:80 with username=, password=***
Downloading: http://(address)/nexus/content/repositories/central/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom

[DEBUG] Writing tracking file C:\m2repo\org\company\subgroup\subgroup-project\0.2.10\subgroup-project-0.2.10.pom.lastUpdated
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.company.subgroup.project_package:project:0.1: Could not transfer artifact org.company.subgroup:subgroup-project:pom:0.2.10 from/to public (http://(address)/nexus/content/groups/public): Access denied to: http://(address)/nexus/content/groups/public/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom , ReasonPhrase:Forbidden. and 'parent.relativePath' points at wrong local POM @ line 15, column 13
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.company.subgroup.project_package:project:0.1: Could not transfer artifact org.company.subgroup:subgroup-project:pom:0.2.10 from/to public (http://(address)/nexus/content/groups/public): Access denied to: http://(address)/nexus/content/groups/public/org/company/subgroup/subgroup-project/0.2.10/subgroup-project-0.2.10.pom , ReasonPhrase:Forbidden. and 'parent.relativePath' points at wrong local POM @ line 15, column 13
编辑: 使用Wireshark,Maven似乎收到了对其GET请求的403禁止响应。如果Maven外部的相同请求工作正常,为什么Maven会收到这个响应

用于验证GET请求的标题:

user_agent = 'Apache-Maven/3.0.3 (Java 1.8.0_51; Windows Server 2012 R2 6.3)'
headers = { 'Accept-Encoding' : 'gzip',
            'Pragma' : 'no-cache',
            'User-Agent' : user_agent,
            'Host' : proxy.company.org',
            'Accept' : 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2',
            'Proxy-Connection' : 'keep-alive',
          }
找到了答案

settings.xml中的
设置定义为
localhost | company.org

正确的设置是
localhost |*.company.org


由于某些原因,只有Windows Server 2012未能将父POM的主机视为非代理主机之一。如果有人知道为什么会这样,我很好奇,但问题已经解决了。

你已经看到了吗?我还没有看到这个问题,但是正在工作的构建使用相同的(我相信是非NTLM)代理。从3.3.3恢复到3.0.3并没有解决这个问题,也没有在解决方案注释中包含链接的轻量级Vangjar。谢谢。你能通过浏览器直接从2012框进入存储库吗?@theiddlerwins我能,事实上问题已经解决了。请看下面我留下的答案。谢谢