1

I am trying to use this plugin but with gradle:

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

<dependencies>
    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-junit4</artifactId>
        <version>LATEST_VERSION</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20</version>
            <configuration>
                <testFailureIgnore>false</testFailureIgnore>
                <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                </argLine>
                <properties>
                    <property>
                        <name>listener</name>
                        <value>io.qameta.allure.junit4.AllureJunit4</value>
                    </property>
                </properties>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

Instead, if it is not really necessary (because there is any easier way on gradle to proceed) can someone give a clue on how to do it?

FelipeCaparelli
  • 135
  • 3
  • 13
  • Simple answer to this: Does not work cause Gradle is written in (Groovy/Kotlin) and works completely different than Maven does ..so simply no chance you have to find a replacement for that in Gradle... – khmarbaise May 13 '20 at 16:52
  • 1
    The gradle java plugin already does what surefire does in maven – smac89 May 13 '20 at 19:55
  • @smac89 I'm using the gradle allure plugin to do more or less the same thing: https://github.com/allure-framework/allure-gradle – FelipeCaparelli May 16 '20 at 16:13

1 Answers1

0

Have a look at the documentation on testing Java & JVM projects in Gradle. It should answer the basic questions around setting up testing in a Gradle project.

However if you are using specific features of the maven-surefire-plugin that you fail to replicate, please amend your question with more specific elements.

Louis Jacomet
  • 13,661
  • 2
  • 34
  • 43
  • Thanks for your response. I'm trying to add the aspectjweaver JAR and the JVM arg javaagent while preparing the test compilation to execute the allureServe task and to generate some additional test information on my Allure reports. I could solve the problem using this plugin for gradle: https://github.com/allure-framework/allure-gradle – FelipeCaparelli May 16 '20 at 16:10