mercredi 6 novembre 2019

Adding Custom plugins to Allure Framework

I am trying to add a custom plugin to Allure framework

I am working with Java 1.8, Allure 2.12.1, Maven 3.5.0

I got custom plugins designed by one of the Allure developers (https://github.com/baev/allure-report-plugins) and ran mvn build to get the jar file

Copied the jar file to plugins folder in Allure folder structure with the below structure followed

allure-2.12.1
--plugins
----cats-plugins
------cats-plugin-1.0-SNAPSHOT.jar (generated one after running mvn clean verify)
------allure-plugin.yml

In allure-plugin.yml, I modified the data as follows

id: cats
name: Cats Tab Plugin
description: The aggregator add custom tab
extensions:
  - com.github.baev.CatsPlugin
jsFiles:
  - script.js

But when I try to start the allure framework through command-line, got the below error

Generating report to temp directory...
Exception in thread "main" java.lang.NoClassDefFoundError: ru/yandex/qatools/allure/data/plugins/DefaultTabPlugin
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at io.qameta.allure.plugin.DefaultPluginLoader.load(DefaultPluginLoader.java:73)
        at io.qameta.allure.plugin.DefaultPluginLoader.lambda$loadPlugin$0(DefaultPluginLoader.java:57)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
        at io.qameta.allure.plugin.DefaultPluginLoader.loadPlugin(DefaultPluginLoader.java:60)
        at io.qameta.allure.Commands.lambda$createReportConfiguration$0(Commands.java:194)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
        at io.qameta.allure.Commands.createReportConfiguration(Commands.java:197)
        at io.qameta.allure.Commands.generate(Commands.java:104)
        at io.qameta.allure.Commands.serve(Commands.java:130)
        at io.qameta.allure.CommandLine.run(CommandLine.java:159)
        at java.util.Optional.orElseGet(Optional.java:267)
        at io.qameta.allure.CommandLine.main(CommandLine.java:88)
Caused by: java.lang.ClassNotFoundException: ru.yandex.qatools.allure.data.plugins.DefaultTabPlugin
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 35 more

Aucun commentaire:

Enregistrer un commentaire