所以我有一个运行 Jenkins 的项目,它调用 Maven,它调用 Ant(不要问为什么),它运行一系列 JMeter 测试。
我知道 Ant 和 JMeter 的东西很好用。我遇到的问题是尝试将 Maven 添加到组合中时。
我让它调用 pom.xml,它简单地引用了 ant build.xml 文件。我得到的错误如下:
Started by user anonymous
Building in workspace C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\workspace
Parsing POMs
Discovered a new module JMeter-Running-Maven:JMeter-Running-Maven JMeter-Running-Maven
Modules changed, recalculating dependency graph
[workspace] $ java -cp "C:\Users\MURPHYA1\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-agent-1.4.jar;C:\Users\MURPHYA1\Desktop\Code samples\apache-maven-3.1.0-bin\apache-maven-3.1.0\boot\plexus-classworlds-2.4.2.jar" jenkins.maven3.agent.Maven31Main "C:\Users\MURPHYA1\Desktop\Code samples\apache-maven-3.1.0-bin\apache-maven-3.1.0" C:\Users\MURPHYA1\.jenkins\war\WEB-INF\lib\remoting-2.30.jar C:\Users\MURPHYA1\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-interceptor-1.4.jar C:\Users\MURPHYA1\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.4.jar 56391
<===[JENKINS REMOTING CAPACITY]===>channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\workspace\pom.xml run
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Scanning for projects...
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener -
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Building JMeter-Running-Maven 1.0-SNAPSHOT
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building JMeter-Running-Maven 1.0-SNAPSHOT
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - BUILD FAILURE
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Total time: 0.749s
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Finished at: Wed Aug 07 11:10:02 BST 2013
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - Final Memory: 3M/61M
[pool-1-thread-1] INFO hudson.maven.Maven3Builder$MavenExecutionListener - ------------------------------------------------------------------------
[JENKINS] Archiving C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\workspace\pom.xml to C:\Users\MURPHYA1\.jenkins\jobs\JMeter-Running-Mavin\modules\JMeter-Running-Maven$JMeter-Running-Maven\builds\2013-08-07_11-09-52\archive\JMeter-Running-Maven\JMeter-Running-Maven\1.0-SNAPSHOT\JMeter-Running-Maven-1.0-SNAPSHOT.pom
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - BUILD FAILURE
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Total time: 4.863s
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Finished at: Wed Aug 07 11:10:06 BST 2013
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - Final Memory: 3M/61M
[pool-1-thread-1] INFO org.apache.maven.cli.event.ExecutionEventLogger - ------------------------------------------------------------------------
channel stopped
Finished: FAILURE
我的 pom.xml 如下:
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>JMeter-Running-Maven</artifactId>
<groupId>JMeter-Running-Maven</groupId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<ant antfile="${basedir}/build.xml">
<target name="prepare-JMeter-Running-Maven" />
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
有人能指出我哪里出错了吗?谢谢
更新
我在客户端 VDI 机器上运行它,我在运行诸如 mvn install 之类的命令时遇到问题,这给了我诸如连接被拒绝:禁止和超时之类的错误。您认为这是问题所在,还是我的 pom.xml 不正确?