2016-03-09 45 views
1

我正在尝试实现Jmeter Maven集成。当我用JMeter-Maven的插件尝试,我收到错误消息按提到的计算器以下问题:使用jmeter-maven-plugin运行Jmeter脚本时出现冲突错误

Run JMX monitor collector listener using Jmeter Maven Plugin

我改变了我的pom.xml按照上述建议的博客,现在不接收该错误(由com.thoughtworks.xstream.converters.ConversionException:kg.apc.jmeter.jmxmon.JMXMonCollector:kg.apc.jmeter.jmxmon.JMXMonCollector引起)。然而,这并没有解决我的执行问题,现在我面临着错误。

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 45.128 s 
[INFO] Finished at: 2016-03-09T09:22:01+05:30 
[INFO] Final Memory: 46M/958M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter (jmeter-tests) on project medewerkers-it: Execut 
ion jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.10.1:jmeter failed: Plugin com.lazerycode.jmeter:jmeter-maven-plug 
in:1.10.1 or one of its dependencies could not be resolved: Failed to collect dependencies at com.lazerycode.jmeter:jmeter-maven-plugin 
:jar:1.10.1 -> kg.apc:jmeter-plugins:jar:1.0.0 -> org.apache.hbase:hbase:jar:0.90.1-cdh3u0 -> org.apache.thrift:thrift:jar:0.2.0: Faile 
d to read artifact descriptor for org.apache.thrift:thrift:jar:0.2.0: Could not transfer artifact org.apache.thrift:thrift:pom:0.2.0 fr 
om/to cdh.snapshot.repo (https://repository.cloudera.com/content/repositories/snapshots): Failed to transfer file: https://repository.c 
loudera.com/content/repositories/snapshots/org/apache/thrift/thrift/0.2.0/thrift-0.2.0.pom. Return code is: 409 , ReasonPhrase:Conflict 
. -> [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 

我试图改变各种版本,但无法解决这个问题。下面是我使用的pom.xml。任何人都可以请在这方面提供帮助。

<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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <properties> 
     <skipITTests>true</skipITTests> 
     <geb.version>0.10.0</geb.version> 
     <selenium.version>2.48.2</selenium.version> 
     <groovy.version>2.3.6</groovy.version> 
     <spock.version>0.7-groovy-2.0</spock.version> 
     <gson.version>2.3.1</gson.version> 
     <httpclient.version>4.3.4</httpclient.version> 
     <httpcore.version>4.3.2</httpcore.version> 
     <surefire.plugin.version>2.12.4</surefire.plugin.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.spockframework</groupId> 
      <artifactId>spock-core</artifactId> 
      <version>${spock.version}</version> 
      <scope>test</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>org.codehaus.groovy</groupId> 
        <artifactId>groovy-all</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.gebish</groupId> 
      <artifactId>geb-spock</artifactId> 
      <version>${geb.version}</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>${selenium.version}</version> 
      <scope>test</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>com.google.code.gson</groupId> 
        <artifactId>gson</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>com.google.code.gson</groupId> 
      <artifactId>gson</artifactId> 
      <version>${gson.version}</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpclient</artifactId> 
      <version>${httpclient.version}</version> 
      <scope>test</scope> 
     </dependency> 


     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.11</version> 
      <scope>test</scope> 
     </dependency> 

    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>${surefire.plugin.version}</version> 
       <configuration> 
        <skipTests>${skipITTests}</skipTests> 
        <includes> 
         <include>*Spec.*</include> 
        </includes> 
        <systemPropertyVariables> 
         <geb.build.reportsDir>target/test-reports/geb</geb.build.reportsDir> 
        </systemPropertyVariables> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.gmaven</groupId> 
       <artifactId>gmaven-plugin</artifactId> 
       <version>1.4</version> 
       <configuration> 
        <providerSelection>1.8</providerSelection> 
       </configuration> 
       <executions> 
        <execution> 
         <goals> 
          <goal>testCompile</goal> 
         </goals> 
        </execution> 
       </executions> 
       <dependencies> 
        <dependency> 
         <groupId>org.codehaus.gmaven.runtime</groupId> 
         <artifactId>gmaven-runtime-1.8</artifactId> 
         <version>1.4</version> 
         <exclusions> 
          <exclusion> 
           <groupId>org.codehaus.groovy</groupId> 
           <artifactId>groovy-all</artifactId> 
          </exclusion> 
         </exclusions> 
        </dependency> 
        <dependency> 
         <groupId>org.codehaus.groovy</groupId> 
         <artifactId>groovy-all</artifactId> 
         <version>${groovy.version}</version> 
        </dependency> 
        <dependency> 
         <groupId>org.spockframework</groupId> 
         <artifactId>spock-core</artifactId> 
         <version>${spock.version}</version> 
         <exclusions> 
          <exclusion> 
           <groupId>org.codehaus.groovy</groupId> 
           <artifactId>groovy-all</artifactId> 
          </exclusion> 
         </exclusions> 
        </dependency> 
       </dependencies> 
      </plugin> 

      <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 

     <plugin> 
       <groupId>com.lazerycode.jmeter</groupId> 
       <artifactId>jmeter-maven-plugin</artifactId> 
       <version>1.10.1</version> 
       <executions> 
        <execution> 
         <id>jmeter-tests</id> 
         <phase>verify</phase> 
         <goals> 
          <goal>jmeter</goal> 
         </goals> 
         <configuration> 
          <reportDir>${project.build.directory}/jmeter-reports</reportDir> 

           <jmeterPlugins> 
            <plugin> 
             <groupId>kg.apc</groupId> 
             <artifactId>jmeter-plugins</artifactId> 
            </plugin> 

           </jmeterPlugins> 

         </configuration> 
        </execution> 
       </executions> 

       <dependencies> 
         <dependency> 
          <groupId>kg.apc</groupId> 
          <artifactId>jmeter-plugins</artifactId> 
          <version>1.0.0</version> 
         </dependency> 
       </dependencies> 

      </plugin> 

      <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>xml-maven-plugin</artifactId> 
      <version>1.0-beta-2</version> 
      <executions> 
       <execution> 
       <phase>pre-site</phase> 
       <goals> 
        <goal>transform</goal> 
       </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <transformationSets> 
        <transformationSet> 
         <dir>${project.build.directory}/jmeter-reports</dir> 
         <stylesheet>src/test/resources/jmeter-results-detail-report_21.xsl</stylesheet> 
         <outputDir>${project.build.directory}/site/jmeter-results</outputDir> 
         <fileMappers> 
          <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper"> 
           <targetExtension>html</targetExtension> 
          </fileMapper> 
         </fileMappers> 
        </transformationSet> 
       </transformationSets> 
      </configuration> 
     </plugin> 

     </plugins> 
    </build>  
</project> 

我有意提到了其他的依赖关系,只是为了得到清晰的图片。提前致谢!

下面

pom.xml的是我刚才改变,按我在attachedment提到仍然面临着错误

[![<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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 


    <!-- IMPORTANT NOTE --> 
    <!-- 
     This pom.xml does not contain a parent dependency to the webapplications pom.xml. 
     Due to conflicting dependencies, the parent dependency was removed by Lieven Rigo and the Indian team, with consent of Andy Verberne. 

     The child dependency in the webapplications pom.xml has also been removed. 
     This means that maven-wise, the integration test set is a separate project. 

    --> 

    <groupId>net.atos.esuite.webapplications</groupId> 
    <artifactId>medewerkers-it</artifactId> 
    <version>4.5.0.7-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <!-- Project information --> 
    <name>Atos e-Suite : Webapplications : Medewerkers IT testen</name> 

    <properties> 
     <skipITTests>true</skipITTests> 
     <geb.version>0.10.0</geb.version> 
     <selenium.version>2.48.2</selenium.version> 
     <groovy.version>2.3.6</groovy.version> 
     <spock.version>0.7-groovy-2.0</spock.version> 
     <gson.version>2.3.1</gson.version> 
     <httpclient.version>4.3.4</httpclient.version> 
     <httpcore.version>4.3.2</httpcore.version> 
     <surefire.plugin.version>2.12.4</surefire.plugin.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>org.spockframework</groupId> 
      <artifactId>spock-core</artifactId> 
      <version>${spock.version}</version> 
      <scope>test</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>org.codehaus.groovy</groupId> 
        <artifactId>groovy-all</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.gebish</groupId> 
      <artifactId>geb-spock</artifactId> 
      <version>${geb.version}</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-java</artifactId> 
      <version>${selenium.version}</version> 
      <scope>test</scope> 
      <exclusions> 
       <exclusion> 
        <groupId>com.google.code.gson</groupId> 
        <artifactId>gson</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>com.google.code.gson</groupId> 
      <artifactId>gson</artifactId> 
      <version>${gson.version}</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.httpcomponents</groupId> 
      <artifactId>httpclient</artifactId> 
      <version>${httpclient.version}</version> 
      <scope>test</scope> 
     </dependency> 

     <!-- Newly added dependencies--> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.11</version> 
      <scope>test</scope> 
     </dependency> 
     <!-- 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>2.5</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.servlet.jsp</groupId> 
      <artifactId>jsp-api</artifactId> 
      <version>2.1</version> 
     </dependency> 
     --> 
     <!-- 
     <dependency> 
      <groupId>kg.apc</groupId> 
      <artifactId>jmeter-plugins-extras</artifactId> 
      <version>1.1.3</version> 
     </dependency> 


     <dependency> 
      <groupId>org.apache.thrift</groupId> 
      <artifactId>libthrift</artifactId> 
      <version>0.6.1</version> 
     </dependency> 

     <dependency> 
      <groupId>kg.apc</groupId> 
      <artifactId>jmeter-plugins-common</artifactId> 
      <version>1.1.3</version> 
     </dependency> 
     --> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>${surefire.plugin.version}</version> 
       <configuration> 
        <skipTests>${skipITTests}</skipTests> 
        <includes> 
         <include>*Spec.*</include> 
        </includes> 
        <systemPropertyVariables> 
         <geb.build.reportsDir>target/test-reports/geb</geb.build.reportsDir> 
        </systemPropertyVariables> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.gmaven</groupId> 
       <artifactId>gmaven-plugin</artifactId> 
       <version>1.4</version> 
       <configuration> 
        <providerSelection>1.8</providerSelection> 
       </configuration> 
       <executions> 
        <execution> 
         <goals> 
          <goal>testCompile</goal> 
         </goals> 
        </execution> 
       </executions> 
       <dependencies> 
        <dependency> 
         <groupId>org.codehaus.gmaven.runtime</groupId> 
         <artifactId>gmaven-runtime-1.8</artifactId> 
         <version>1.4</version> 
         <exclusions> 
          <exclusion> 
           <groupId>org.codehaus.groovy</groupId> 
           <artifactId>groovy-all</artifactId> 
          </exclusion> 
         </exclusions> 
        </dependency> 
        <dependency> 
         <groupId>org.codehaus.groovy</groupId> 
         <artifactId>groovy-all</artifactId> 
         <version>${groovy.version}</version> 
        </dependency> 
        <dependency> 
         <groupId>org.spockframework</groupId> 
         <artifactId>spock-core</artifactId> 
         <version>${spock.version}</version> 
         <exclusions> 
          <exclusion> 
           <groupId>org.codehaus.groovy</groupId> 
           <artifactId>groovy-all</artifactId> 
          </exclusion> 
         </exclusions> 
        </dependency> 
       </dependencies> 
      </plugin> 

      <!-- Newly added plugins--> 
      <!--    
      <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 
     --> 
     <plugin> 
       <groupId>com.lazerycode.jmeter</groupId> 
       <artifactId>jmeter-maven-plugin</artifactId> 
       <version>1.10.1</version> 
       <executions> 
        <execution> 
         <id>jmeter-tests</id> 
         <phase>verify</phase> 
         <goals> 
          <goal>jmeter</goal> 
         </goals> 
         <configuration> 
          <reportDir>${project.build.directory}/jmeter-reports</reportDir> 

           <jmeterPlugins> 
            <plugin> 
             <groupId>kg.apc</groupId> 
             <artifactId>jmeter-plugins</artifactId> 
            </plugin> 

           </jmeterPlugins> 

         </configuration> 
        </execution> 
       </executions> 

       <dependencies> 
         <dependency> 
          <groupId>kg.apc</groupId> 
          <artifactId>jmeter-plugins</artifactId> 
          <version>1.0.0</version> 
         </dependency> 
       </dependencies> 

      </plugin> 


      <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>xml-maven-plugin</artifactId> 
      <version>1.0-beta-2</version> 
      <executions> 
       <execution> 
       <phase>pre-site</phase> 
       <goals> 
        <goal>transform</goal> 
       </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <transformationSets> 
        <transformationSet> 
         <dir>${project.build.directory}/jmeter-reports</dir> 
         <stylesheet>src/test/resources/jmeter-results-detail-report_21.xsl</stylesheet> 
         <outputDir>${project.build.directory}/site/jmeter-results</outputDir> 
         <fileMappers> 
          <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper"> 
           <targetExtension>html</targetExtension> 
          </fileMapper> 
         </fileMappers> 
        </transformationSet> 
       </transformationSets> 
      </configuration> 
     </plugin> 

     </plugins> 
    </build> 

    <!-- 
    <repositories> 
     <repository> 
      <releases> 
       <enabled>false</enabled> 
       <updatePolicy>always</updatePolicy> 
       <checksumPolicy>warn</checksumPolicy> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
       <updatePolicy>never</updatePolicy> 
      <checksumPolicy>fail</checksumPolicy> 
      </snapshots> 
      <id>codehausSnapshots</id> 
      <name>Codehaus Snapshots</name> 
      <url>http://snapshots.maven.codehaus.org/maven2</url> 
      <layout>default</layout> 
     </repository> 
    </repositories> 

    --> 


    <!-- 
    <repositories> 
     <repository> 
    <id>central</id> 
    <url>http://repo1.maven.org/maven2/</url> 
    </repository> 
    </repositories> 
    --> 
    <pluginRepositories> 
    <pluginRepository> 
     <id>sonatype-snapshots</id> 
     <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 
    </pluginRepository> 
</pluginRepositories> 

</project>][1]][1] 

回答

0

你从这个传递依赖问题的痛苦:

https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/issues/142

您可以尝试使用插件的2.0.0-SNAPSHOT版本来查看是否使事情变得更好,依赖关系解析代码已被重写,新代码可以更好地处理它(您可以添加替代依赖项尝试解决问题)。

这真的是Maven中心的jmeter-plugins版本的问题。

如果你决定试试看看CHANGELOG.md看看到底发生了什么样的变化正在转移到2.0.0-SNAPSHOT(维基还没有更新为2.0.0,因为它还没有被释放

您还需要使用Sonatype的快照库在你的POM文件:

<!-- Use this to allow us to use a SNAPSHOT version of the jmeter-maven-plugin --> 
<pluginRepositories> 
    <pluginRepository> 
     <id>sonatype-snapshots</id> 
     <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 
    </pluginRepository> 
</pluginRepositories> 
+0

包含上述更改后,我依然面临着版本冲突的错误。你能帮忙吗?谢谢 – Durgesh

+0

你能证明你已经做了什么,所以我可以看看它吗? – Ardesco

+0

嗨,Ardesco,我已经粘贴了修改后的pom.xml,并按照你的建议添加了错误日志代码片段。谢谢你的帮助 – Durgesh

0

使用版本的plugin

2.6.0现在管理着更好的依赖关系,并具有智能默认值。

如果您还需要排除一些神器则可以使用:

<excludedArtifacts> 
     <exclusion>commons-pool2:commons-pool2</exclusion> 
</excludedArtifacts> 
相关问题