4

When I try to create allure report by allure-jenkins-plugin I get such error:

ERROR: Publisher ru.yandex.qatools.allure.jenkins.AllureReportPublisher aborted due to exception
java.io.IOException: java.lang.NullPointerException
    at ru.yandex.qatools.allure.jenkins.utils.ReportGenerator.invoke(ReportGenerator.java:50)
    at ru.yandex.qatools.allure.jenkins.utils.ReportGenerator.invoke(ReportGenerator.java:25)
    at hudson.FilePath.act(FilePath.java:991)
    at hudson.FilePath.act(FilePath.java:969)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.generateReport(AllureReportPublisher.java:267)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisher.perform(AllureReportPublisher.java:146)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:764)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:724)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1769)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: java.lang.NullPointerException
    at ru.yandex.qatools.clay.internal.AetherUtils.getRepositoriesAsList(AetherUtils.java:183)
    at ru.yandex.qatools.clay.Aether.<init>(Aether.java:60)
    at ru.yandex.qatools.clay.Aether.aether(Aether.java:78)
    at ru.yandex.qatools.allure.jenkins.utils.ReportGenerator.createAether(ReportGenerator.java:69)
    at ru.yandex.qatools.allure.jenkins.utils.ReportGenerator.invoke(ReportGenerator.java:45)
    ... 14 more

xml-file created by allure is valid (I may create correct report with maven goal "site" with the same xml), so the problem must be in jenkins plugin.

I have maven 3.2.5 installed, settings.xml exists in ~/.m2 directory and seems to be correct.

What may be the reason of such error? Seems that it's somehow connected with maven settings.

Fabien
  • 859
  • 6
  • 15
  • Looking at the code of the plugin and `AetherUtils`, it's not really clear why this happens. The plugin seems to have some poor release management practices, but it seems that (unlike most Jenkins plugins) you should try reporting this as a bug here: https://github.com/allure-framework/allure-jenkins-plugin/issues – Christopher Orr May 01 '15 at 13:59

3 Answers3

1

It might happen due to :

  1. Allure is not installed in the Jenkin.

STEPS:

Go to Manage Jenkins > 
Global Tool Configuration >
Allure Commandline > 
Add Allure Commandline > 
Uncheck "Install automatically"

Download the latest allure commandline from maven repo - https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/

Unzip the file and provide the location

Installation directory : C:\allure-2.17.2 (I am using windows, jenkin)

Ranjit
  • 135
  • 7
0

The problem was in maven settings.xml file, in

<activeProfiles> 

section. It contained profile, that in fact didn't exist. Removing this profile solved the problem.

0

This error happens when Allure Commandline is not installed on Jenkins agent.

I had such error when i forgot to set Name of the Allure Commandline installation in "Manage Jenkins" -> "Global Tool Configuration". For some reason in this case Allure Commandline distribution is not pushed to the agent to be installed on it.

yaromir
  • 378
  • 7
  • 17