Skip to content
Advertisement

ClassNotFoundException in cucumber framework

I am using Cucumber framework for mobile app testing. In pom.xml, I have given this below plugin to run TestClass.java – which has code for uploading the latest APK version of the app. Main method is present inside this TestClass. I need this to run before the actual test execution. So I have used exec plugin. I’m getting this error if I am running with pom.xml –> mvn clean test. ClassNotFoundExpection is always thrown with pom.xml, but the individual class runs perfectly.

pom.xml:

JavaScript

Console error:

JavaScript

I also tried changing the phase after test-compile. Still i am getting the same error. Someone pls help.

Advertisement

Answer

According to the exec-maven-plugin documentation, the default dependency scope for the execution is runtime. Please change it to test with the following configuration if the TestClass is part of the test sources.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement