Reputation: 521
I'm trying to implement Allure2 as a reporting tool for our automation suite but I seem to be running into an issue with the @Step
annotation.
I have the imports in place, the IDE recognizes it perfectly, I can see the package under dependencies and the specific class is available to browse and everything seems to be correct but when I try to run the test I get this error:
java.lang.NoSuchMethodError: io.qameta.allure.aspects.StepsAspects.aspectOf()Lio/qameta/allure/aspects/StepsAspects;
If I remove the @Step
annotation everything works perfectly, including the report.
Googling around all I could find was that this very same issue seemed to have been solved during beta and I'm using the latest version as of today. I also have this implemented on another project and it works great with the same versions but even after scouring through both pom.xml
files I can't figure out where I might be screwing up.
Here are the relevant bits of my pom settings.
<properties>
<!--DEPENDENCIES VERSIONS-->
<allure2.version>2.6.0</allure2.version>
<allure.maven.version>2.9</allure.maven.version>
<maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
<aspectj.version>1.9.1</aspectj.version>
</properties>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>${allure2.version}</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>${allure.maven.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<systemPropertyVariables>
<allure.directory>${project.build.directory}/allure-results</allure.directory>
<allure.results.directory>${project.build.directory}/allure-results</allure.results.directory>
</systemPropertyVariables>
<suiteXmlFiles>
<suiteXmlFile>testng-run.xml</suiteXmlFile>
</suiteXmlFiles>
<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>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>${allure.maven.version}</version>
<configuration>
<properties>
<allure.issues.tracker.pattern>######################</allure.issues.tracker.pattern>
<allure.tests.management.pattern>#######################</allure.tests.management.pattern>
</properties>
</configuration>
</plugin>
I don't think specifying the allure-maven
dependency in both places is necessary. Just to rule it out I've tried with it only in the plugin section and same issue.
Any thoughts?.
Upvotes: 2
Views: 2655
Reputation: 2753
You are probably using custom aop.xml
configuration file thats excludes Allure aspects from weaving. Make sure that package io.qameta.allure
is included in weaver configuration
Upvotes: 2