在Jenkins中构建时无法下载Maven资源插件

在Jenkins中构建时无法下载Maven资源插件,maven,selenium,plugins,jenkins,Maven,Selenium,Plugins,Jenkins,我已经创建了SeleniumIDE测试用例,并在Eclipse中对它们进行了测试。该项目是一个Maven java项目,测试将在Eclipse中正常运行,但是,当我将该项目添加到Jenkins并尝试构建我的项目时,出现了一个错误和构建失败 错误: Started by user anonymous Building in workspace C:\Program Files (x86)\Jenkins\workspace\Selenium IDE Recon Parsing POMs Disco

我已经创建了SeleniumIDE测试用例,并在Eclipse中对它们进行了测试。该项目是一个Maven java项目,测试将在Eclipse中正常运行,但是,当我将该项目添加到Jenkins并尝试构建我的项目时,出现了一个错误和构建失败

错误:

Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Selenium IDE Recon
Parsing POMs
Discovered a new module Test:SeleniumTest SeleniumTest
Modules changed, recalculating dependency graph
[Selenium IDE Recon] $ C:\java/bin/java -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-agent-1.5.jar;C:\Users\MC44948\Software\springsource\springsource\apache-maven-3.0.4\boot\plexus-classworlds-2.4.jar" org.jvnet.hudson.maven3.agent.Maven3Main C:\Users\MC44948\Software\springsource\springsource\apache-maven-3.0.4 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-2.45.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-1.5.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar" 53032
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f C:\Users\MC44948\Spring_Workspace\Selenium IDE Recon\pom.xml install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building SeleniumTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.671s
[INFO] Finished at: Mon Sep 29 11:46:35 BST 2014
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
[JENKINS] Archiving C:\Users\MC44948\Spring_Workspace\Selenium IDE Recon\pom.xml to Test/SeleniumTest/0.0.1-SNAPSHOT/SeleniumTest-0.0.1-SNAPSHOT.pom
[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
channel stopped
Finished: FAILURE
由匿名用户启动
在工作区中生成C:\Program Files(x86)\Jenkins\workspace\Selenium IDE Recon
解析pom
发现一个新的模块测试:SeleniumTest SeleniumTest
模块已更改,正在重新计算依赖关系图
[Selenium IDE Recon]$C:\java/bin/java-cp“C:\Program Files(x86)\Jenkins\plugins\maven plugin\WEB-INF\lib\maven3-agent-1.5.jar;C:\Users\MC44948\Software\springsource\springsource\apache-maven-3.0.4\boot\plexus-classworlds-2.4.jar”org.jvnet.hudson.maven3.agent.Maven3Main C:\Users\MC44948\Software\springsource\springsource\apache\maven-3.0.4“C:\Program Files(x86)\Jenkins\war\WEB-INF\lib\remoting-2.45.jar”“C:\Program Files(x86)\Jenkins\plugins\maven plugin\WEB-INF\lib\maven3-interceptor-1.5.jar”“C:\Program Files(x86)\Jenkins\plugins\maven plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar”53032
频道启动
正在执行Maven:-B-f C:\Users\MC44948\Spring\u Workspace\Selenium IDE Recon\pom.xml安装
[信息]正在扫描项目。。。
[信息]
[信息]------------------------------------------------------------------------
[信息]正在构建SeleniumTest 0.0.1-SNAPSHOT
[信息]------------------------------------------------------------------------
下载:http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:0.671s
[信息]完成时间:2014年9月29日星期一11:46:35英国夏令时
[信息]最终内存:4M/8M
[信息]------------------------------------------------------------------------
等待Jenkins完成数据收集
[错误]Plugin org.apache.maven.plugins:maven resources Plugin:2.5或其一个依赖项无法解析:无法读取org.apache.maven.plugins:maven resources Plugin:jar:2.5:无法将工件org.apache.maven.plugins:maven resources Plugin:pom:2.5从/传输到中心(http://repo.maven.apache.org/maven2):repo.maven.apache.org:未知主机repo.maven.apache.org->[帮助1]
[JENKINS]存档C:\Users\MC44948\Spring\u Workspace\Selenium IDE Recon\pom.xml到Test/SeleniumTest/0.0.1-SNAPSHOT/SeleniumTest-0.0.1-SNAPSHOT.pom
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
通道停止
完成:失败
我的pom:

<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>

    <groupId>Test</groupId>
    <artifactId>SeleniumTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>SeleniumTest</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.43.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.opera</groupId>
            <artifactId>operadriver</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>2.43.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>2.6.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.opera</groupId>
                <artifactId>operadriver</artifactId>
                <version>0.16</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.seleniumhq.selenium</groupId>
                        <artifactId>selenium-remote-driver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>

4.0.0
试验
硒测试
0.0.1-快照
罐子
硒测试
http://maven.apache.org
UTF-8
朱尼特
朱尼特
4.6
测试
org.seleniumhq.selenium
硒爪哇
2.43.0
测试
com.opera
操作驾驶员
测试
org.seleniumhq.selenium
硒铬驱动器
2.43.0
测试
org.seleniumhq.selenium
硒服务器
2.6.0
测试
com.opera
操作驾驶员
0.16
测试
org.seleniumhq.selenium
selenium远程驱动程序

这似乎与Internet连接有关。您是否注意到错误:
“未知主机repo.maven.apache.org”

尝试
wgethttp://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
并查看是否可以获取数据

有关更多详细信息,请参阅链接。

您也可以尝试此。。。 从命令行构建时,我的Java项目构建成功,但使用Jenkins构建时,我遇到了一个错误“未知主机repo.maven.apache.org”

问题是我们公司使用的自定义maven设置文件

所以,您可以做的是:在“作业配置”下的“构建”部分,单击“高级…”。 将“设置文件”设置为“文件系统中的设置文件”,并给出从maven安装位置到设置文件的路径 C:\ProgramFiles\apache-maven-3.1.1\conf\settings.xml


“全局设置文件”设置为“文件系统上的全局设置文件”,并给出“${user.home}/.m2/Settings.xml”

您可能在协作代理(或任何其他代理\防火墙)后面。 确保您可以从运行构建的从属服务器访问maven central

如果没有-在服务器上配置http_代理和https_代理