Skip to content
Advertisement

Error integration Allure reporting with Jenkins. Can’t find allure commandline

Please help, I just have no clue what is going wrong, I’ve tried everything… This is a QA test project, based on java17, maven, testng. IntegrŠµtion between Jenkins and Allure doesn’t work, what is going wrong?

I have post condition in Jenkins file :

         post {
          always {
             allure includeProperties: false, jdk: '', reportBuildPolicy: 'ALWAYS', results: [[path: 'target/allure-results']]
            deleteDir()

And when I’m running pipeline on Jenkins side, I get below error in console output

Pipeline allure Error when executing always post condition: Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to ubuntu-20.04 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1797) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:1001) at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation.getMajorVersion(AllureCommandlineInstallation.java:63) at ru.yandex.qatools.allure.jenkins.ReportBuilder.build(ReportBuilder.java:52) at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:312) at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:231) at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:100) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:70) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) java.io.IOException: Can’t find allure commandline at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$GetMajorVersion.call(AllureCommandlineInstallation.java:74) at ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation$GetMajorVersion.call(AllureCommandlineInstallation.java:65) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:376) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.lang.Thread.run(Thread.java:833)

Integration with Allure installed correctly on Jenkins side ( I’ve tried to remove “/bin” path from HOME directory in Jenkins Agent config, but it didn’t helped. Project use java17, maven.

Pom file:
<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>0</modelVersion>

    <groupId>lol</groupId>
    <artifactId>lol</artifactId>
    <version>1</version>

    <name>lol</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <aspectj.version>1.9.7</aspectj.version>
        <java.version>17</java.version>
        <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
        <maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
        <org.apache.logging.log4j.version>2.14.1</org.apache.logging.log4j.version>
        <org.slf4j.version>1.7.26</org.slf4j.version>
        <com.google.guava.version>27.1-jre</com.google.guava.version>
        <org.apache.commons-lang.version>3.9</org.apache.commons-lang.version>
        <org.apache.commons.version>4.3</org.apache.commons.version>
        <org.testng.version>7.4.0</org.testng.version>
        <io.rest-assured.version>4.3.1</io.rest-assured.version>
        <io.rest-assured.json-schema-validator.version>${io.rest-assured.version}
        </io.rest-assured.json-schema-validator.version>
        <com.google.code.gson.version>2.8.5</com.google.code.gson.version>
        <com.googlecode.json-simple.version>1.1.1</com.googlecode.json-simple.version>
        <org.projectlombok.version>1.18.22</org.projectlombok.version>
        <io.jsonwebtoken.version>0.10.5</io.jsonwebtoken.version>
        <org.bouncycastle.version>1.66</org.bouncycastle.version>
        <io.qameta.allure.version>2.13.8</io.qameta.allure.version>
        <com.fasterxml.jackson.core.version>2.9.9</com.fasterxml.jackson.core.version>
        <org.sonarsource.scanner.maven.version>3.7.0.1746</org.sonarsource.scanner.maven.version>
        <software.amazon.awssdk.verison>2.8.7</software.amazon.awssdk.verison>
        <commons-io.verison>2.6</commons-io.verison>
        <codeborne.version>5.19.0</codeborne.version>
        <org.awaitility.version>4.0.2</org.awaitility.version>
        <jacoco.plugin.version>0.8.6</jacoco.plugin.version>
        <selenium.version>3.141.59</selenium.version>
        <bmp.version>2.1.5</bmp.version>
        <ashot-version>1.5.4</ashot-version>
        <extentreports-version>5.0.8</extentreports-version>
        <resources>src/test/resources/</resources>
        <pathToSuite>test-suites/cf/regression.xml</pathToSuite>
        <sonar.java.source>${java.version}</sonar.java.source>
        <sonar.coverage.jacoco.xmlReportPaths>
            target/site/jacoco/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.aventstack</groupId>
            <artifactId>extentreports</artifactId>
            <version>${extentreports-version}</version>
        </dependency>

        <dependency>
            <groupId>ru.yandex.qatools.ashot</groupId>
            <artifactId>ashot</artifactId>
            <version>${ashot-version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${org.apache.logging.log4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <version>${org.slf4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>${org.awaitility.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${com.google.guava.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${org.apache.commons-lang.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${org.apache.commons.version}</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${org.testng.version}</version>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${io.rest-assured.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>commons-lang3</artifactId>
                    <groupId>org.apache.commons</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>json-schema-validator</artifactId>
            <version>${io.rest-assured.json-schema-validator.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${com.google.code.gson.version}</version>
        </dependency>

        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>${com.googlecode.json-simple.version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${org.projectlombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>${io.jsonwebtoken.version}</version>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>${io.jsonwebtoken.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>${io.jsonwebtoken.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>${org.bouncycastle.version}</version>
        </dependency>

        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>${io.qameta.allure.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${com.fasterxml.jackson.core.version}</version>
        </dependency>

        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>aws-sdk-java</artifactId>
            <version>${software.amazon.awssdk.verison}</version>
        </dependency>

        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>cloudwatchlogs</artifactId>
            <version>${software.amazon.awssdk.verison}</version>
        </dependency>

        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>url-connection-client</artifactId>
            <version>${software.amazon.awssdk.verison}</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.verison}</version>
        </dependency>

        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-java-commons</artifactId>
            <version>${io.qameta.allure.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.codeborne</groupId>
            <artifactId>selenide</artifactId>
            <version>${codeborne.version}</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-remote-driver</artifactId>
            <version>${selenium.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>net.lightbody.bmp</groupId>
            <artifactId>browsermob-core</artifactId>
            <version>${bmp.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <suiteXmlFiles>
                        <suiteXmlFile>${resources}${pathToSuite}</suiteXmlFile>
                    </suiteXmlFiles>
                    <systemPropertyVariables>
                        <testng.dtd.http>true</testng.dtd.http>
                    </systemPropertyVariables>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <release>${java.version}</release>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${org.sonarsource.scanner.maven.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>regression</id>
        </profile>
        <profile>
            <id>sanity</id>
        </profile>
    </profiles>

</project>

Advertisement

Answer

Allure jenkins install config

I found the answer by myself, this is some kind of issue in fresh versions of allure-commandline, try to :

  1. install old version, for instance 2.8.0
  2. then you could install any new version

Seems like in old version, while installation, it’s creating path(for ubuntu in my case) in correct direction, and then just update with a new one… Or you can insert installation directory manually and initially install a new version

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement