Junit5 + Allure + Maven. java.lang.ClassNotFoundException: NoClassDefFoundError: Invoke$AjcClosure1
Использую kotlin + junit5 + allure для формирования результатов, при запуске тестов через мавен падает ошибка
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.343 s <<< FAILURE! - in pro.Test
[ERROR] pro.Tests Time elapsed: 1.342 s <<< ERROR!
java.lang.NoClassDefFoundError: pro/scripts/Invoke$AjcClosure1
Caused by: java.lang.ClassNotFoundException: pro.scripts.Invoke$AjcClosure1
Если заккоментить строчку javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" , то падает аллюр:
Can not cast io.qameta.allure.model.TestResult@baa9ce4 to class io.qameta.allure.model.StepResult
Мой POM:
<properties>
<!-- Java 8 -->
<java.version>1.8</java.version>
<compiler.target.version>${java.version}</compiler.target.version>
<compiler.source.version>${java.version}</compiler.source.version>
<!-- Encoding -->
<default.encoding>UTF-8</default.encoding>
<project.build.sourceEncoding>${default.encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${default.encoding}</project.reporting.outputEncoding>
<!-- Dependency versions -->
<commons.io.version>2.6</commons.io.version>
<qatools.properties.version>2.0.RC6</qatools.properties.version>
<shutterbug.version>0.7</shutterbug.version>
<apacheds-all>2.0.0-M24</apacheds-all>
<apacheds-server-jndi>2.0.0-M24</apacheds-server-jndi>
<apacheds-core-api>2.0.0-M24</apacheds-core-api>
<slf4j.version>1.8.0-beta2</slf4j.version>
<log.level>info</log.level>
<kotlin.version>1.3.30</kotlin.version>
<junit.api.version>5.5.2</junit.api.version>
<junit.jupiter.version>5.5.2</junit.jupiter.version>
<junit.platform.version>1.3.1</junit.platform.version>
<aspectj.version>1.9.4</aspectj.version>
<allure.version>2.14.0</allure.version>
<!--Tests-->
<includeTags>NONE</includeTags>
</properties>
<dependencies>
<!--Kotlin deps-->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit5</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<properties>
<includeTags>${includeTags}</includeTags>
<excludeTags>${exclude.tags}</excludeTags>
</properties>
<includes>
<include>**/*.java</include>
</includes>
<testFailureIgnore>true</testFailureIgnore>
<forkCount>${fork.count}</forkCount>
<!--<reuseForks>false</reuseForks>-->
<parallel>classes</parallel>
<threadCount>1</threadCount>
<systemProperties>
<junit.jupiter.extensions.autodetection.enabled>true
</junit.jupiter.extensions.autodetection.enabled>
</systemProperties>
<argLine>
-Dfork.number=${surefire.forkNumber}
-Dorg.slf4j.simpleLogger.levelInBrackets=true
-Dorg.slf4j.simpleLogger.showThreadName=false
-Dorg.slf4j.simpleLogger.showLogName=false
-Dorg.slf4j.simpleLogger.defaultLogLevel=${log.level}
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<systemPropertyVariables>
<property>
<name>listener</name>
<value>io.qameta.allure.junit5.AllureJunit5</value>
</property>
<property>
<name>allure.results.directory</name>
<value>${project.build.directory}/allure-results</value>
</property>
</systemPropertyVariables>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.10.0</version>
<configuration>
<reportVersion>${allure.version}</reportVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>before-tests</id>
<phase>generate-test-resources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>pro.fixtures.BeforeTestsFixtureKt</mainClass>
</configuration>
</execution>
<execution>
<id>after-tests</id>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>pro.fixtures.AfterTestsFixtureKt</mainClass>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>