jenkinsci / allure-plugin

Allure Jenkins Plugin
https://plugins.jenkins.io/allure-jenkins-plugin/
Other
84 stars 66 forks source link

Allure is not visible in Post-build action dropdown on Jenkins job #350

Open Gabber4K opened 7 months ago

Gabber4K commented 7 months ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux Ubuntu 22.04 VM, openJDK 11

Reproduction steps

  1. Install Jenkins 2.440.1
  2. Install Allure Jenkins Plugin Version 2.31.1
  3. Go to Freestyle job and try to add Allure as post-build action

Expected Results

See Allure under post-build action in Jenkins job

Actual Results

Allure is not available in the dropdown

Anything else?

No response

Are you interested in contributing a fix?

No response

Gabber4K commented 7 months ago

Noticed that if you install an older Allure version, it is fixed. The allure report appears in the post-build dropdown.

GregYeo commented 5 months ago

I'm having same problem

Jenkins: Version 2.447 (By container) Allure Jenkins Plugin Version2.31.1 installed from jenkins plugin page

The configuration of Allure Commandline installations is available but it is not appeared on the post-build action menu and pipeline syntax(allure) is also not available.

GregYeo commented 5 months ago

I've found the error log in jenkins

Apr 25, 2024 6:21:50 AM WARNING hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
Failed to instantiate Key[type=ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor, annotation=[none]]; skipping this component
java.lang.ClassNotFoundException: hudson.matrix.MatrixAggregatable
    at java.base/java.net.URLClassLoader.findClass(Unknown Source)
    at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:35)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
Caused: java.lang.NoClassDefFoundError: hudson/matrix/MatrixAggregatable
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
    at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.base/java.net.URLClassLoader.defineClass(Unknown Source)
    at java.base/java.net.URLClassLoader$1.run(Unknown Source)
    at java.base/java.net.URLClassLoader$1.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/java.net.URLClassLoader.findClass(Unknown Source)
    at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:35)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor.<init>(AllureReportPublisherDescriptor.java:56)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor$$FastClassByGuice$$173cf4bd.GUICE$TRAMPOLINE(<generated>)
    at ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor$$FastClassByGuice$$173cf4bd.apply(<generated>)
    at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
    at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33)
    at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
    at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:610)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
Caused: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/ErrorInjectingConstructor]: NoClassDefFoundError: hudson/matrix/MatrixAggregatable
  at AllureReportPublisherDescriptor.<init>(AllureReportPublisherDescriptor.java:56)

Learn more:
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR

1 error

======================
Full classname legend:
======================
AllureReportPublisherDescriptor: "ru.yandex.qatools.allure.jenkins.AllureReportPublisherDescriptor"
========================
End of classname legend:
========================

    at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
    at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:445)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
    at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
    at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:403)
    at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:394)
    at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:335)
    at hudson.ExtensionList.load(ExtensionList.java:384)
    at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320)
    at hudson.ExtensionList.iterator(ExtensionList.java:172)
    at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1674)
    at hudson.plugins.git.GitSCM.onLoaded(GitSCM.java:2160)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109)
    at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
    at jenkins.model.Jenkins$5.runTask(Jenkins.java:1170)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120)
    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
MeirP-3 commented 2 months ago

Short answer Install Matrix Project plugin

Explanation: The error message says ClassNotFoundException: hudson.matrix.MatrixAggregatable.

The plugin source code imports hudson.matrix.MatrixAggregatable.

This class is defined in Matrix Project plugin: link.

Installing the plugin solved the problem for me.