Есть отличная удаленная работа для php+codeception+jenkins+allure+docker спецов. 100% remote! Присоединиться к проекту

org.testng.ITestNGListener: Provider io.qameta.allure.testng.AllureTestNg could not be instantiated

maven
selenium
testng
allure
Теги: #<Tag:0x00007f7b69282d78> #<Tag:0x00007f7b69282a80> #<Tag:0x00007f7b692828c8> #<Tag:0x00007f7b69282710>

(Elena Gook) #1

Подключаю Allure2 по инструкции (https://docs.qameta.io/allure/#_testng)
Есть главный пом файл который собирает набор проектов, аллюр пытаюсь подключить в проект с тестами

Ошибка:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project auto-tests: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: There was an error in the forked process
[ERROR] java.util.ServiceConfigurationError: org.testng.ITestNGListener: Provider io.qameta.allure.testng.AllureTestNg could not be instantiated
[ERROR] at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581)
[ERROR] at java.base/java.util.ServiceLoader.access$100(ServiceLoader.java:390)
[ERROR] at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:799)
[ERROR] at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:721)
[ERROR] at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1389)
[ERROR] at org.testng.TestNG.addServiceLoaderListeners(TestNG.java:946)
[ERROR] at org.testng.TestNG.initializeConfiguration(TestNG.java:886)
[ERROR] at org.testng.TestNG.initializeEverything(TestNG.java:975)
[ERROR] at org.testng.TestNG.run(TestNG.java:988)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:91)
[ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:204)
[ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:107)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
[ERROR] at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.(JaxbAnnotationIntrospector.java:139)
[ERROR] at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.(JaxbAnnotationIntrospector.java:126)
[ERROR] at io.qameta.allure.model.Allure2ModelJackson.createMapper(Allure2ModelJackson.java:26)
[ERROR] at io.qameta.allure.FileSystemResultsWriter.(FileSystemResultsWriter.java:30)
[ERROR] at io.qameta.allure.AllureLifecycle.getDefaultWriter(AllureLifecycle.java:281)
[ERROR] at io.qameta.allure.AllureLifecycle.(AllureLifecycle.java:47)
[ERROR] at io.qameta.allure.Allure.getLifecycle(Allure.java:30)
[ERROR] at io.qameta.allure.testng.AllureTestNg.(AllureTestNg.java:119)
[ERROR] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[ERROR] at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
[ERROR] at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:777)
[ERROR] … 13 more
[ERROR] Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlElement
[ERROR] at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
[ERROR] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
[ERROR] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
[ERROR] … 26 more

Главный пом:

<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>silverspin</groupId>
    <artifactId>qa-automation</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <!-- Technical information (optional) -->
    <name>qa-automation</name>
    <description>Automation of Functional Test Cases</description>
    <url>https://wiki.jackpotjoygroup.com/display/ITDEV/QA+Automation</url>

    <modules>
        <module>SeleniumCore</module>
        <module>AutoTests</module>
        <module>Infrastructure</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <project.version>0.0.1-SNAPSHOT</project.version>

        <!--Settings for report folders-->
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>yyyy-MM-dd_HH-mm</maven.build.timestamp.format>
        <sureFireDir>${project.basedir}/reports/${timestamp}</sureFireDir>

        <!-- global -->
        <log4j.version>2.11.0</log4j.version>
        <testng.version>6.13.1</testng.version>
        <commons-io.version>2.6</commons-io.version>
        <mockito.version>1.9.5</mockito.version>
        <lombok.version>1.16.20</lombok.version>

        <!-- selenium-core project-->
        <selenium-java.version>3.10.0</selenium-java.version>
        <webdrivermanager.version>2.2.2</webdrivermanager.version>
        <!-- guava excluded in selenium and reflections dependencies because of different versions, this required to use the same version:  -->
        <google.guava.version>23.6-jre</google.guava.version>

        <!-- automation-core -->
        <apache-commons-io.version>2.6</apache-commons-io.version>

        <!-- infrastructure -->
        <javax.json.version>1.1.2</javax.json.version>
        <json-path.version>2.4.0</json-path.version>
        <gson.version>2.8.2</gson.version>
        <commons-lang.version>2.6</commons-lang.version>
        <spring.version>5.0.4.RELEASE</spring.version>
        <reflections.version>0.9.11</reflections.version>
        <javax.annotation-api.version>1.3.2</javax.annotation-api.version>
        <javax.el.version>3.0.1-b09</javax.el.version>
        <hibernate-validator-cdi.version>6.0.10.Final</hibernate-validator-cdi.version>
        <httpclient.version>4.5.3</httpclient.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Пом проекта с тестами:

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>
    <artifactId>auto-tests</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>silverspin</groupId>
        <artifactId>qa-automation</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>

    <properties>
        <aspectj.version>1.8.10</aspectj.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.6.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>silverspin</groupId>
            <artifactId>selenium-core</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>

Пробовала добавлять зависимости по этой теме (Интеграция Google Sheets JAVA API в проект с allure-testng)

Не помогло.
Я уже пыталась подключить по разным инструкциям что были в поиске но папка allure-results либо не генерировалась либо была пустой.

Подскажите пожалуйста где ошибка или другой вариант подключения Аллюр2
Спасибо!