getting java.lang.NoClassDefFoundError: org/testng/IInvokedMethodListener2 error for testng maven project in intellij - maven

I have tried adding the TestNG jar files to the project folder removing the testNG dependencies and adding them again
but the issue is not resolved still showing the same error

if you are using the Gradle plugin and are still having this issue, change allureJavaVersion in build.gradle to version or higher:
allure {
version = '2.13.2'
autoconfigure = true
aspectjweaver = true
allureJavaVersion = '2.13.2'
}
if you are using maven update allure with version 2.13.2 or higher
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.13.2</version>
</dependency>
Ref: https://github.com/allure-framework/allure-java/pull/422

Related

Failed to add RXjava dependency from pom file in intellij

I tried to open a maven project with Intellij. The project was originally created on eclipse and worked fine.
However I receive an error
Dependency 'io.reactivex.rxjava2:rxjava:2.2.19' not found
(I get the same error if I try to start a new project in Intellij with the rxjava dependency)
Here is my dependencies section in the POM file:
<dependencies>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.19</version>
</dependency>
</dependencies>
What am I doing wrong?
running
mvn clean install
from command line, solved the issue

Unable to debug a gradle plugin

I have developed a Gradle plugin. Since the latest upgrade of gradle, that plugin is failing, and I need to debug the plugin in order to find out what exactly is going wrong. I am, however, unable to debug the plugin.
I'm doing the following:
I set the following environment parameters: GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
I execute the build running the plugin from the commandline
I attach my IntelliJ debugger to the running process.
This immediately fails however with a ClassNotFoundException in IntelliJ: org.gradle.launcher.GradleMain.
The plugin should work with all gradle versions. The plugin itself has following gradle relevant dependencies:
<dependency>
<scope>provided</scope>
<groupId>org.gradle</groupId>
<artifactId>gradle-core</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<scope>provided</scope>
<groupId>org.gradle</groupId>
<artifactId>gradle-plugins</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<scope>provided</scope>
<groupId>org.gradle</groupId>
<artifactId>gradle-base-services</artifactId>
<version>1.12</version>
</dependency>
I have tried adding following dependency as well:
<dependency>
<scope>provided</scope>
<groupId>org.gradle</groupId>
<artifactId>gradle-wrapper</artifactId>
<version>4.5.1</version>
</dependency>
But that doesn't make any difference.
The difficulty here is that the plugin should work with all Gradle versions (version 1.12 up to 4.5). That is the reason why the plugin itself depends on old versions of Gradle at compile time. Where the different versions of Gradle differ, I currently resort to reflection to achieve my goal at runtime.
While Gradle 1.12 is in the dependencies of the project, the build being debugged uses Gradle 4.5.1. However, even if I switch the gradle version of the project being debugged, the same error remains. Also, as the plugin works fine on all versions prior to 4.5, such a debug session wouldn't help alot even if I would get it working.
Any ideas on how I can get the debugger to debug the plugin?

How to fix: Error message in TestNG java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z

How to solve the following error message
java.lang.AbstractMethodError:
org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z in
automation project with Java, Selenium Server (having the
configuration : client-combined-3.7.1-sources, client-combined-3.7.1,
commo ns-lang-2.6, org.eclipse.jgit_4.5.0.201609210915-r,
selenium-firefox-driver-3.0.0-beta1, selenium-server-standalone-3.7.1
firefox v. 44)
I have tried many combinations of selenium server & selenium Firefox driver but I was receiving other errors
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.7.1</version>
</dependency>
</dependencies>
Only these lines of code I am using:
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Aila\\Downloads\\geckodriver-v0.19.1-win32\\geck‌​odriver.exe");
driver = new FirefoxDriver();
There are two solution for this isssue:
Adding correct version in Selenium project coz different version don't have same solution for my issue selenium-server-standalone-2.42.2.jar is correct.
This one is optional just try, if any of solution of this issue is not resolve.
Open Windows Command Prompt and type the command below:
java -Dwebdriver.gecko.driver="C:\NewAutomationCICD\resource\chromedriver.exe" -jar C:\NewAutomationCICD\libs\selenium-server-standalone-2.42.2.jar
The error says it all:
java.lang.AbstractMethodError: org.openqa.selenium.MutableCapabilities.is(Ljava/lang/String;)Z in automation project with Java, Selenium Server (having the configuration : client-combined-3.7.1-sources, client-combined-3.7.1, commo ns-lang-2.6, org.eclipse.jgit_4.5.0.201609210915-r, selenium-firefox-driver-3.0.0-beta1, selenium-server-standalone-3.7.1
First of all ensure that you are using all the binaries and jars of latest version (Selenium, GeckoDriver, Firefox Browser).
If you want to use Maven :
Remove all the Selenium related jars which you have added manually from your project.
Use Selenium and TestNG related jars only through Maven Dependencies.
Clean the Project
Execute mvn clean install test
If you want to use Selenium and TestNG without Maven:
Remove all the Selenium related jars once and add only the selenium-server-standalone-3.7.1 within your project.
Clean the Project
Execute your #Test as TestNG Test or TestNG Suite

How to include custom type converter using Maven and Grails

I am working on a Grails project that needs to compile with both Grails and Maven. Everything worked great except for my GSON converter I added (using the grails-gson plugin). Now I get the following when I run mvn install.
unable to resolve class grails.plugin.gson.converters.GSON
Anyone know how to overcome this
Plugin has to be added as a dependency in pom.xml too
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>gson</artifactId>
<version>1.1.4</version>
<type>zip</type>
</dependency>
Mavenized grails project refer pom file for all dependencies (including plugin dependencies).

A conflicting jar is being added to Maven dependencies - how to track down?

I have a dependency that I have added to my project:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>7.0.5</version>
</dependency>
When I compile and run I get an error indicating a mismatch of signatures. Looking at my Maven Dependencies in my Java Build Path (Eclipse) I see a jar being added by Maven for Vaadin version 6.8.8. I have scoured my pom.xml and do not see that I have added that. I assume that this dependency is being added by another dependency.
I definitely want to use Vaadin version 7.0.5. As long as version 6.8.8 keeps getting included it will be an issue. How can I resolve this?
mvn dependency:tree
Once you have its output you can add a suitable exclusion.

Resources