Skip to content

Problem with Browserstack Dependencies.  #15

@herbert-soares-ifood

Description

@herbert-soares-ifood

Hi.

I`m utilizing Appium + JUnit + Maven + Java.

I have problems with dependencies for Browserstack.

When i utilize this command line, my tests Failed on Jenkins:

<plugins>
  <plugin>
    <groupId>com.browserstack</groupId>
    <artifactId>automate-maven-plugin</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <configuration>
        <source>${jdk.source.version}</source>
        <target>${jdk.target.version}</target>
        <complianceLevel>${jdk.source.version}</complianceLevel>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>test-compile</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
</plugins>

This is my error on JENKINS:

--- AspectJ Properties ---
AspectJ Compiler 1.8.7 built on Wednesday Sep 9, 2015 at 21:19:30 GMT
---- Dump Properties ---
Dump file: ajcore.20190820.143242.876.txt
Dump reason: org.aspectj.apache.bcel.classfile.ClassFormatException
Dump on exception: true
Dump at exit condition: abort
---- Exception Information ---
org.aspectj.apache.bcel.classfile.ClassFormatException: File: '/Users/hebertsoares/Documents/Git/ifood-consumer-automation/target/test-classes/META-INF/versions/9/module-info.class': Invalid byte tag in constant pool: 19
at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:192)
at
org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:131)

When i delete this command, my tests run well:

      <execution>
        <goals>
          <goal>test-compile</goal>
        </goals>
      </execution>
    </executions>

Can you help me, please?

My POM File:

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

<dependencies>
    <!-- log4j -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <!-- Allure Report -->

    <!-- Cucumber Dependencies -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${cucumber-junit.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber-java.version}</version>
    </dependency>
    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>${cucumber-reporting.version}</version>
    </dependency>
    <!-- jUnit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit}</version>
    </dependency>
    <!-- Appium -->
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>${appium.version}</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.ibm.icu</groupId>
        <artifactId>icu4j</artifactId>
        <scope>provided</scope>
        <version>3.4.4</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.8.7</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.8.7</version>
    </dependency>
    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>browserstack-local-java</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>automate-testassist</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>


<!-- Build  -->

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

        <!--Plugins to pack the app for AWS-->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>${maven-jar-plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>test-jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>${maven-dependency-plugin.version}</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>${maven-assembly-plugin.version}</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <finalName>zip-with-dependencies</finalName>
                        <appendAssemblyId>false</appendAssemblyId>
                        <descriptors>
                            <descriptor>src/main/assembly/zip.xml</descriptor>
                        </descriptors>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>com.browserstack</groupId>
            <artifactId>automate-maven-plugin</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <complianceLevel>1.8</complianceLevel>
            </configuration>
        </plugin>
    </plugins>
</build>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions