DEV Community

Cover image for Allure and Jenkins
gcalvoCR
gcalvoCR

Posted on

Allure and Jenkins

In order to use Allure inside Jenkins you basically need 3 things:

  1. Under Jenkins > Manage Jenkins > Manage Plugins install the Allure plugin.

Alt Text

  1. Then, under Jenkins > Manage Jenkins > Global Tool Configuration you also need to install the Allure Commandline. In order to do so, you can try to installing it automatically from the Maven Central Repo, as follows:

Alt Text

  1. In each project, set the path to the allure-results directory.

That's it, we're ready to generate Allure reports.

The first time you run your job, Jenkins will try to download the installation zip file and install the Allure Commandline for you.

If for some reason it gives you a problem similar to the following:

[Checks API] No suitable checks publisher found.
java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.6/allure-commandline-2.13.6.zip
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3061)
    at java.net.URLConnection.getHeaderFieldLong(URLConnection.java:628)
    at java.net.URLConnection.getContentLengthLong(URLConnection.java:500)
    at java.net.URLConnection.getContentLength(URLConnection.java:484)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:412)
    at org.jvnet.robust_http_client.RetryableHttpStream.<init>(RetryableHttpStream.java:90)
Caused: java.io.IOException: Server returned HTTP response code: 401 for URL: https://repo.jenkins-ci.org/maven-repo1/io/qameta/allure/allure-commandline/2.13.6/allure-commandline-2.13.6.zip
Enter fullscreen mode Exit fullscreen mode

The problem is that you're trying to connect to https://repo.jenkins-ci.org and you probably don't have permission.

What you could do is try install the Allure Commandline Jenkins > Manage Jenkins > Global Tool Configuration a different way. Rather than trying to get the zip installer from

  • https://repo.jenkins-ci.org
  • Try getting directly from https://repo.maven.apache.org.

Check https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/ to determin which version you need.

Then, write the url of the zip version you want to install, for example:

https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.13.5/allure-commandline-2.13.5.zip

And you'll be fine. The installer should look similar to the following:

Alt Text

Apply the changes, go back to the job and see the magic happening!

I hope this helps anyone!

Top comments (0)