Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.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无法从Artifactory存储库下载_Maven_Jenkins_Artifactory - Fatal编程技术网

Maven无法从Artifactory存储库下载

Maven无法从Artifactory存储库下载,maven,jenkins,artifactory,Maven,Jenkins,Artifactory,我正在尝试将我们的Jenkins服务器连接到构建的Artifactory存储库。我已经成功地在我的办公室使用了Jenkins服务器,但是我在公司网络的另一部分使用Jenkins服务器时遇到了问题 我已禁用作业,进入工作区,并尝试直接使用mvn: $ mvn clean [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [IN

我正在尝试将我们的Jenkins服务器连接到构建的Artifactory存储库。我已经成功地在我的办公室使用了Jenkins服务器,但是我在公司网络的另一部分使用Jenkins服务器时遇到了问题

我已禁用作业,进入工作区,并尝试直接使用
mvn

$ mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] PROJ Generic Aggregate POM
[INFO] PROJ Generic Module
[INFO] PROJ Generic Features
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building PROJ Generic Aggregate POM 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
然后在吐出来之前就结冰了:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] PROJ Generic Aggregate POM ........................ FAILURE [2:06.295s]
[INFO] PROJ Generic Module ............................... SKIPPED
[INFO] PROJ Generic Features ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:07.160s
[INFO] Finished at: Wed Feb 11 18:16:46 EST 2015
[INFO] Final Memory: 8M/149M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.vegicorp.net/artifactory/plugins-release): Connection to http://repo.vegicorp.net refused: Connection timed out -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
to
但是,如果我试图通过
curl
获取该URL,它将毫无问题地下载。与
wget
相同:

$ curl http://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
<?xml version='1.0' encoding='UTF-8'?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
还有一个文件
~/.m2/repositories/org/apache/maven/plugins/maven-clean-plugins/2.4.1/maven-clean-plugin-2.4.1.pom.lastUpdate
,内容如下:

#NOTE: This is an internal implementation file, its format can be changed without prior notice.
#Wed Feb 11 18:16:46 EST 2015
da39a3ee5e6b4b0d3255bfef95601890afd80709@proxy.gain.tcprod.local\:3128>2f606e371a64780e100321226a9f68a38c8b7906@default-http\://repo.vegicorp.net/artifactory/plugins-release/.lastUpdated=1423695463870
2f606e371a64780e100321226a9f68a38c8b7906@default-http\://repo.vegicorp.net/artifactory/plugins-release/.lastUpdated=1423696543392
http\://repo.vegicorp.net/artifactory/plugins-release/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:2.4.1 from/to central (http\://repo.vegicorp.net/artifactory/plugins-release)\: Connection to http\://repo.vegicorp.net refused
http\://repo.fusesource.com/nexus/content/repositories/releases/.lastUpdated=1423694766347
http\://repo.vegicorp.net/artifactory/plugins-snapshot/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:2.4.1 from/to snapshots (http\://repo.vegicorp.net/artifactory/plugins-snapshot)\: Connection to http\://repo.vegicorp.net refused
2f606e371a64780e100321226a9f68a38c8b7906@default-http\://repo.vegicorp.net/artifactory/plugins-snapshot/.lastUpdated=1423696606400
http\://repo.fusesource.com/nexus/content/repositories/releases/.error=
http\://repo.vegicorp.net/artifactory/plugins-release/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:2.4.1 from/to central (http\://repo.vegicorp.net/artifactory/plugins-release)\: Failed to transfer file\: http\://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Return code is\: 504 , ReasonPhrase\:Gateway Time-out.

这看起来像是代理设置问题。你能把mvn帮助:有效的设置添加到问题中吗?谢谢

我要哭了

$ mvn help:effective-settings
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] PROJ Generic Aggregate POM
[INFO] PROJ Generic Module
[INFO] PROJ Generic Features
Downloading: http://repo.fusesource.com/nexus/content/repositories/releases/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
Downloading: http://repo.vegicorp.net/artifactory/plugins-release/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
然后它冻结并显示:

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7

对不起。我无法运行mvn帮助:有效设置,因为我的设置…

看起来像是代理设置问题。您能在问题中添加
mvn帮助:有效设置的输出吗?谢谢见我答案的附录。我无法让它工作,因为我无法与我的Maven服务器通信。仍然存在下载问题,无法执行有效的pom内容。然而,它在下载方面做得更好。然后,我查看了
pom.xml
,发现其中有存储库设置。这就是问题的核心所在。我从
pom.xml
中删除了这些设置,它做得好多了。OMFG,这个Maven杀了我!当然,您不能对网络设置进行故障排除,因为它需要从网络下载故障排除插件:我放弃:(我给JFrog打了个电话。)。
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7