解析POM时出错

时间:2016-12-09 14:36:50

标签: java maven jenkins browserstack

我正在尝试将Browserstack与jenkins集成,使用maven构建用于测试的Java代码。

然而,当我运行Job时,我遇到了这个错误,几乎崩溃了构建和后续步骤。

[WARNING] The POM for org.codehaus.mojo:aspectj-maven-plugin:jar:1.8 is   invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

导致下一个我认为相关的错误:

[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) on project NewTest: Execution default of goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile failed: A required class was missing while executing com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile: org/apache/commons/lang/StringUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/com/browserstack/automate-maven-plugin/0.7.2-SNAPSHOT/automate-maven-plugin-0.7.2-SNAPSHOT.jar
[ERROR] urls[1] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[2] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[3] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[4] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[5] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[7] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[8] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[9] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/mojo/aspectj-maven-plugin/1.8/aspectj-maven-plugin-1.8.jar
[ERROR] urls[10] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/aspectj/aspectjtools/1.8.7/aspectjtools-1.8.7.jar
[ERROR] urls[11] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/com/browserstack/automate-testassist/0.7.2-SNAPSHOT/automate-testassist-0.7.2-SNAPSHOT.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.apache.commons.lang.StringUtils
[ERROR] -> [Help 1]

这是我的pom文件,它也使用了正确版本的openjdk:

<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>NewTest</groupId>
  <artifactId>NewTest</artifactId>
  <version>0.1-Unittest</version>
    <dependencies>      
    <!--
    <dependency>                
         <groupId>junit</groupId>                               
         <artifactId>junit</artifactId>                             
         <version>3.8.1</version>                               
         <scope>test</scope>                                
    </dependency>               
    <dependency>                
        <groupId>org.seleniumhq.selenium</groupId>                              
        <artifactId>selenium-java</artifactId>                              
        <version>2.45.0</version>                               
        </dependency>               
    <dependency>                
        <groupId>org.testng</groupId>                               
        <artifactId>testng</artifactId>                             
        <version>6.8</version>                              
        <scope>test</scope>                                     
       </dependency>
      -->
        <dependency>
            <groupId>com.browserstack</groupId>
            <artifactId>automate-testassist</artifactId>
            <version>0.7.2-SNAPSHOT</version>
    </dependency>
</dependencies>

<repositories>
  <repository>
    <id>sonatype-nexus-snapshots</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  </repository>
</repositories>

<pluginRepositories>
  <pluginRepository>
   <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  </pluginRepository>
</pluginRepositories>

<build>
    <plugins>
      <plugin>
    <groupId>com.browserstack</groupId>
    <artifactId>automate-maven-plugin</artifactId>
    <version>0.7.2-SNAPSHOT</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <complianceLevel>1.8</complianceLevel>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>test-compile</goal>
        </goals>
      </execution>
    </executions>
      </plugin>
    </plugins>
</build>



</project>

不确定会出现什么问题。

1 个答案:

答案 0 :(得分:1)

这里的罪魁祸首是docker kill $1。错误消息也清楚地读了这个

  

[错误]无法执行目标   com.browserstack:自动化 - Maven的插件:0.7.2-快照:测试编译   项目NewTest上的(默认):目标的执行默认值   com.browserstack:自动化 - Maven的插件:0.7.2-快照:测试编译   失败:执行时缺少必需的类   com.browserstack:自动化 - Maven的插件:0.7.2-快照:测试编译:   组织/阿帕奇/公地/郎/ StringUtils的

同样尝试使用automate-maven-plugin的{​​{1}}以及指定相同的0.7.2-SNAPSHOT一般不会起作用。好像你在当地建设和使用它。所以可能你可以继续更新插件。