Error in Selenium Maven and Jenkins integration - maven

I am a New to integrating selenium code built using Maven and integrating with selenium. My selenium code works fine in local through TestNG but while integrating with Jenkins or running as a Maven build its throwing the below error.
I have tried updating Maven and also mvn clean install. but nothing is working out
Am i using wrong versions of jars for selenium, extent reports, poi etc.. Attaching my pom.XML and error for your reference
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project Selenium: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] Cannot instantiate class executionEngine.DriverScriptTest
[ERROR] at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:31)
[ERROR] at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:332)
[ERROR] at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:81)
[ERROR] at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:98)
[ERROR] at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:119)
[ERROR] at org.testng.TestRunner.initMethods(TestRunner.java:353)
[ERROR] at org.testng.TestRunner.init(TestRunner.java:227)
[ERROR] at org.testng.TestRunner.init(TestRunner.java:197)
[ERROR] at org.testng.TestRunner.<init>(TestRunner.java:142)
Below is my POM.XML 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>4.0.0</modelVersion>
<groupId>Automation</groupId>
<artifactId>Selenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Selenium</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>forplay-legacy</id>
<url>http://forplay.googlecode.com/svn/mavenrepo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.relevantcodes/extentreports -->
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/xml-apis/xml-apis -->
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<properties>
<suiteXmlFile>C:/Users/ADC_2/eclipse-workspace/Selenium_workingcode_1026/testng.xml</suiteXmlFile>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<compilerVersion>1.8</compilerVersion>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>

Related

Can't compile TestNG test suite (Maven+Surefire)

I'm trying to run test suite from command line "mvn clean test"
But i'm getting error like:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project automation: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\Vartotojas\Desktop\Automatiniai testia\automation\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] Suite file C:\Users\Vartotojas\Desktop\Automatiniai testia\automation\AllTestsRelease.xml is not a valid file
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
here is my full POM.xml file:
<groupId>automation</groupId>
<artifactId>automation</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<sourceDirectory>src/main</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<resources>
<resource>
<directory>src/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>
src/testResources
</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.9</version>
<configuration>
<reportVersion>2.6.0</reportVersion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<!--<testFailureIgnore>true</testFailureIgnore>-->
<useSystemClassLoader>false</useSystemClassLoader>
<threadCount>1</threadCount>
<suiteXmlFiles>
<suiteXmlFile>AllTestsRelease.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<xmlName>tst</xmlName>
<maven-surefire-plugin.version>2.20</maven-surefire-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<aspectj.version>1.9.2</aspectj.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<log4j.version>1.2.17</log4j.version>
<sel4j.version>1.7.25</sel4j.version>
<glassfish.version>2.26-b03</glassfish.version>
<allure-testng.version>2.6.0</allure-testng.version>
<ashot.version>1.5.4</ashot.version>
<extentReport.version>2.41.2</extentReport.version>
<jsonSimple.version>1.1.1</jsonSimple.version>
<testng.version>6.9.10</testng.version>
<io.appium>4.1.2</io.appium>
<selenium.version>3.14.0</selenium.version>
<webdriver.download>3.6.1</webdriver.download>
<extentreports.version>4.0.9</extentreports.version>
<org.json>20180813</org.json>
</properties>
<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>${org.json}</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>${extentreports.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${sel4j.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${glassfish.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
<version>${glassfish.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${glassfish.version}</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>${allure-testng.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>${ashot.version}</version>
</dependency>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>${extentReport.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>${jsonSimple.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>${webdriver.download}</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.15</version>
</dependency>
</dependencies>
Build is success if i delete suiteXMLfiles tag
<suiteXmlFile>AllTestsRelease.xml</suiteXmlFile>
what i do wrong here? i need suitesXMLFiles tag to run test suite
and here is code of AllTestsRelease.xml file:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Release Suite">
<test name="ALL TESTS" parallel="methods" thread-count="5">
<groups>
<define name="release">
<include name="Release"/>
</define>
<run>
<include name="Regression"/>
<include name="Release"/>
</run>
</groups>
<classes>
<class name="Search"/>
</classes>
</test>
</suite>
Try to provide the full path to your AllTestsRelease.xml file, e.g.
<suiteXmlFile>src/test/java/testSuites/AllTestsRelease.xml</suiteXmlFile>

Maven Failed to initialize ear modules: Unknown artifact type[zip] for release-documentation

Environment:
Java 11
Maven 3.6.3
I added the following dependency on submodule pom.xml EJB and the problem came up
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.3</version>
<type>pom</type>
</dependency>
pom.xml root
<dependencyManagement>
<dependencies>
...
<dependency>
<groupId>org.jvnet.mimepull</groupId>
<artifactId>mimepull</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-jaxb-xjc</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.1.13</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.xml.bing</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
...
</dependencies>
</dependencyManagement>
pom.xml (ear)
<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>4.0.0</modelVersion>
<parent>
<groupId>es.domain.app</groupId>
<artifactId>app2</artifactId>
<version>8.0.0</version>
</parent>
<artifactId>app-ear</artifactId>
<packaging>ear</packaging>
<name>app-ear</name>
<description>Arxiu d'aplicacio EAR de app</description>
<dependencies>
<!-- Especificacions i llibreries proporcionades per JBoss -->
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-8.0</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Mòduls que van dins l'application.xml -->
<dependency>
<groupId>es.domain.app</groupId>
<artifactId>app-back</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>es.domain.app</groupId>
<artifactId>app-commons</artifactId>
<type>jar</type>
</dependency>
<dependency>
<groupId>es.domain.app</groupId>
<artifactId>app-ejb</artifactId>
<type>ejb</type>
</dependency>
<dependency>
<groupId>es.domain.app</groupId>
<artifactId>app-front</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>es.domain.app</groupId>
<artifactId>app-ws</artifactId>
<type>ejb</type>
</dependency>
</dependencies>
<build>
<finalName>${project.parent.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<generateApplicationXml>true</generateApplicationXml>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<includeLibInApplicationXml>false</includeLibInApplicationXml>
<outputFileNameMapping>#{artifactId}#-#{version}#.#{extension}#</outputFileNameMapping>
<version>8</version>
<archive>
<manifestEntries>
<project-version>${project.version}</project-version>
<project-buildtime>${maven.build.timestamp}</project-buildtime>
<scm-revision>${buildNumber}</scm-revision>
</manifestEntries>
</archive>
<modules>
<webModule>
<groupId>es.domain.app</groupId>
<artifactId>app-back</artifactId>
<bundleFileName>app-back.war</bundleFileName>
<contextRoot>/app2back</contextRoot>
</webModule>
<ejbModule>
<groupId>es.domain.app</groupId>
<artifactId>app-ejb</artifactId>
<bundleFileName>app-ejb.jar</bundleFileName>
</ejbModule>
<webModule>
<groupId>es.domain.app</groupId>
<artifactId>app-front</artifactId>
<bundleFileName>app-front.war</bundleFileName>
<contextRoot>/app2front</contextRoot>
</webModule>
<ejbModule>
<groupId>es.domain.app</groupId>
<artifactId>app-ws</artifactId>
<bundleFileName>app-ws.jar</bundleFileName>
</ejbModule>
</modules>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<skip>false</skip>
<deployables>
<deployable>
<properties>
<name>${project.build.finalName}</name>
</properties>
</deployable>
</deployables>
</configuration>
</plugin>
<!-- Defineix la propietat ${buildNumber} que s'empra al filtrat -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
I have no issues with the following commands:
mvn dependency:resolve
mvn dependency:tree
No clue how to find out what is happening...
Error log
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:3.1.0:generate-application-xml (default-generate-application-xml) on project app-ear: Failed to initialize ear modules: Unknown artifact type[zip] for relea
se-documentation -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :app-ear
...
Try excluding the documentation. You may also have to exclude samples.
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>2.3.3</version>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>com.sun.xml.ws</groupId>
<artifactId>release-documentation</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.ws</groupId>
<artifactId>samples</artifactId>
</exclusion>
</exclusions>
</dependency>

Can't run test from Maven in TeamCity with testNG and Allure

I'm trying to run my testClass in TeamCity by Maven. And I have this error -
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project PGRegression: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process java.lang.NoSuchMethodError: ru.yandex.qatools.allure.events.TestSuiteStartedEvent.withTitle(Ljava/lang/String;)Lru/yandex/qatools/allure/events/TestSuiteStartedEvent;
my buildSteps goals in TeamCity -
clean
test -Dtest=testClass verify
I'm using pom example from here - https://github.com/allure-framework/allure-core/wiki/TestNG
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
</argLine>
<!--only for 1.3.* TestNG adapters. Since 1.4.0.RC4, the listener adds via ServiceLoader-->
<properties>
<property>
<name>listener</name>
<value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
</property>
</properties>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
If I run another testClass without yandex allure - its work great and I have not this error. I'm using for allure in my pom this -
<properties>
<aspectj.version>1.8.9</aspectj.version>
<allure.version>1.4.23</allure.version>
<!--<allure.version>{latest-allure-version}</allure.version>-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-model</artifactId>
<version>1.4.23</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-commons</artifactId>
<version>1.3.9</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-annotations</artifactId>
<version>1.4.23</version>
</dependency>
You're using different major versions of Allure artifacts:
You're using Allure Commons 1.3.9:
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-commons</artifactId>
<version>1.3.9</version>
</dependency>
And here we have 1.4.23.
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-annotations</artifactId>
<version>1.4.23</version>
</dependency>
This is why you get NoSuchMethodError. Please don't do this. Instead simply depend on allure-testng dependency:
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>

Allure Jenkins plugin error when generating a report

The following error occurs while generating a report using the Allure Jenkins Plugin (plugin version 2.6):
Suggest something to correct it.
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running my.company.SimpleTest
Configuring TestNG with: TestNG652Configurator
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.673 sec - in my.company.SimpleTest
Results :
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.818 s
[INFO] Finished at: 2015-07-31T16:47:01+03:00
[INFO] Final Memory: 25M/343M
[INFO] ------------------------------------------------------------------------
Ожидаю пока Jenkins закончит сбор данных
[JENKINS] Archiving C:\Jenkins\workspace\allure\pom.xml to ru.yandex.qatools.allure/allure-testng-example/1.0-SNAPSHOT/allure-testng-example-1.0-SNAPSHOT.pom
channel stopped
Allure Report Generation: started
Allure Report Generation: find directories by mask [**/allure-results]
Allure Report Generation: found allure result directories [C:\Jenkins\workspace\allure\target\allure-results]
Allure Report Generation: copy founded directories in directory [C:\Jenkins\workspace\allure\allure8063768305174617023.tmp\results]
Allure Report Generation: generate report from directory [C:\Jenkins\workspace\allure\allure8063768305174617023.tmp]
Allure Report Generation: proxy settings [active:'false', host:'null', port:'0', username:'null', password: '']
ERROR: Publisher 'Allure Report Generation' aborted due to exception:
java.io.IOException: ru.yandex.qatools.allure.report.AllureReportBuilderException: java.lang.ClassNotFoundException: ru.yandex.qatools.allure.data.AllureReportGenerator
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:989)
at hudson.FilePath.act(FilePath.java:967)
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:776)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1763)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Caused by: ru.yandex.qatools.allure.report.AllureReportBuilderException: java.lang.ClassNotFoundException: ru.yandex.qatools.allure.data.AllureReportGenerator
at ru.yandex.qatools.allure.report.AllureReportBuilder.processResults(AllureReportBuilder.java:133)
at ru.yandex.qatools.allure.jenkins.utils.ReportGenerator.invoke(ReportGenerator.java:47)
... 14 more
Caused by: java.lang.ClassNotFoundException: ru.yandex.qatools.allure.data.AllureReportGenerator
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at ru.yandex.qatools.allure.report.AllureReportBuilder.processResults(AllureReportBuilder.java:129)
... 15 more
Finished: FAILURE
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>4.0.0</modelVersion>
<parent>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-examples-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>allure-testng-example</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<allure.version>1.4.15</allure.version>
<aspectj.version>1.8.5</aspectj.version>
</properties>
<name>Allure TestNG Example</name>
<description>Allure TestNG and WebDriver Usage Example</description>
<dependencies>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
<!--Needed only to show reports locally. Run jetty:run and
open localhost:8080 to show the report-->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.10.v20150310</version>
<configuration>
<webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
<stopKey>stop</stopKey>
<stopPort>1234</stopPort>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</reporting>
</project>
When I run mvn clean test site, from the project folder it's works fine.
Does anyone get this error?
Please use below pom.xml and try,
<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>4.0.0</modelVersion>
<groupId>com.123</groupId>
<artifactId>testThisAllure</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SampleTRForAllure</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.7</compiler.version>
<!-- <allure.version>1.4.0.RC3</allure.version> -->
<allure.version>1.4.13</allure.version>
<aspectj.version>1.8.5</aspectj.version>
<aetherVersion>0.9.0.M2</aetherVersion>
<mavenVersion>3.1.0</mavenVersion>
<wagonVersion>2.6</wagonVersion>
</properties>
<build>
<plugins>
<!-- Compiler plug-in -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${jdk.level}</source>
<target>${jdk.level}</target>
</configuration>
</plugin>
<!-- Below plug-in is used to execute tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<suiteXmlFiles>
<!-- TestNG suite XML files -->
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}\org\aspectj\aspectjweaver\${aspectj.version}\aspectjweaver-${aspectj.version}.jar"
</argLine>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<properties>
<property>
<name>listener</name>
<value>ru.yandex.qatools.allure.testng.AllureTestListener</value>
</property>
</properties>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</reporting>
<!-- Include the following dependencies -->
<dependencies>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-testng-adaptor</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-annotations</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-aspects</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-report-data</artifactId>
<version>${allure.version}</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-java-commons</artifactId>
<version>1.4.0.RC9</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.allure</groupId>
<artifactId>allure-commons</artifactId>
<version>1.4.0.RC4</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.10-FINAL</version>
</dependency>
</dependencies>
</project>

Unresolveable build extension while resolving grails plugins using maven

I am trying to compile a grails project using maven. I am getting the following error
[INFO] Scanning for projects...
[WARNING] The POM for org.grails.plugins:kickstart-with-bootstrap:jar:1.1.0 is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.test:temp2:0.1 (/mnt/data/Work/Tutorials/Practice/grails/temp2/pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin org.grails.plugins:kickstart-with-bootstrap:1.1.0 or one of its dependencies could not be resolved: Failure to find org.grails.plugins:kickstart-with-bootstrap:jar:1.1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR] Unknown packaging: grails-app # line 9, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
The error is such that I am not even able to generate the dependency tree. I am attaching my pom.xml. Could anyone please tell me where I am going wrong.
<?xml version="1.0" encoding="utf-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>temp2</artifactId>
<packaging>grails-app</packaging>
<version>0.1</version>
<name>temp2</name>
<description>temp2</description>
<properties>
<grails.version>2.4.2</grails.version>
<h2.version>1.3.170</h2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-dependencies</artifactId>
<version>${grails.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-test</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-plugin-testing</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-datastore-test-support</artifactId>
<version>1.0-grails-2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>scaffolding</artifactId>
<version>2.1.2</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>cache</artifactId>
<version>1.1.7</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>asset-pipeline</artifactId>
<version>1.8.11</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>hibernate4</artifactId>
<version>4.3.5.4</version>
<scope>runtime</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>database-migration</artifactId>
<version>1.4.0</version>
<scope>runtime</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jquery</artifactId>
<version>1.11.1</version>
<scope>runtime</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>tomcat</artifactId>
<version>7.0.54</version>
<scope>provided</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>webxml</artifactId>
<version>1.4.1</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<pluginManagement/>
<plugins>
<!-- Disables the Maven surefire plugin for Grails applications, as we have our own test runner -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<configuration>
<filesets>
<fileset>
<directory>plugins</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<grailsVersion>${grails.version}</grailsVersion>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.grails.plugins</groupId>
<artifactId>kickstart-with-bootstrap</artifactId>
<version>1.1.0</version>
<configuration>
<grailsVersion>${grails.version}</grailsVersion>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>grails</id>
<name>grails</name>
<url>http://repo.grails.org/grails/core</url>
</repository>
<repository>
<id>grails-plugins</id>
<name>grails-plugins</name>
<url>http://repo.grails.org/grails/plugins</url>
</repository>
</repositories>
<profiles>
<profile>
<id>tools</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
You have 2 implementations incorrect here:
kickstart-with-bootstrap is a grails plugin dependency therefore it should be under <dependencies> section in pom.xml, instead of a maven plugin.
Grails plugins are packaged as zip and not jar, so the <type> of dependency should be zip
Solution:
Remove this section
<plugin>
<groupId>org.grails.plugins</groupId>
<artifactId>kickstart-with-bootstrap</artifactId>
<version>1.1.0</version>
<configuration>
<grailsVersion>${grails.version}</grailsVersion>
</configuration>
<extensions>true</extensions>
</plugin>
and add this section under <dependencies>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>kickstart-with-bootstrap</artifactId>
<version>1.1.0</version>
<type>zip</zip>
</dependency>

Resources