I have a project in Eclipse and a class who run a TESTNG suite programmatically:
one very simple test class in the src directory
and a pon xml who containd a dependency to TestNG.
IF I run the App class the output is correct, but if I ran
java -cp target/axway-0.0.1-SNAPSHOT.jar anda.firsttestNG.axway.App
from cmd with Maven I got:
Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/xml/XmlSuite
at anda.firsttestNG.axway.App.main(App.java:18)
Caused by: java.lang.ClassNotFoundException: org.testng.xml.XmlSuite
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)