0

I am trying to integrate Browserstack with jenkins, using maven to build java code for testing.

However when I run the Job I got this errors and pretty much crashes the build and next steps.

[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

that leads to the next errors what I think are related:

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

Here is my pom file which also uses the right version of the 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>

No sure what would be the issue.

  • Based on the message I assume your Jenkins is not allowed to download all needed files...You should check the whole log file on errors WARNINGS etc... – khmarbaise Dec 09 '16 at 16:15
  • So far i am realizing that the problem could be dependencies in automate-maven-plugin, I triend aspectj-maven-plugin:jar:1.9 standalone and it worked, and at the same time automate-maven-plugin failed looking for version 1.8 – Yeris Antonio Dec 09 '16 at 16:19

1 Answers1

1

The culprit here is automate-maven-plugin used by you. The error message as well clearly reads this

[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

Also trying to use the 0.7.2-SNAPSHOT of automate-maven-plugin along with specifying the same pluginRepositories wouldn't work in general. Seems like you are locally building and using this. So probably you can go ahead and update the plugin possibly.

Naman
  • 27,789
  • 26
  • 218
  • 353
  • 1
    I am waiting to see if there is a kind of bug with outdated libraries, from browserstack, not sure if I can manually specify a aspectj-maven-plugin version. – Yeris Antonio Dec 09 '16 at 20:08
  • @YerisAntonio You need to contact the library owners to get the bug fixed. Probably using `aspectj-maven-plugin` is a call you shall take depending on your requirements which I doubt are listed above. – Naman Dec 13 '16 at 07:08