Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFound Exception -testng exception

 
chandramouli mahadevan
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run the testng.xml using pom.xml but the class that is inside this testng.xml refers to another class that isn't in pom.xml. I have added it to the classpath and added the necessary class as a dependency too. However, I still get a ClassNotFoundException that still remains when I do mvn install.
Let me just explain what i want as the output,Suppose there are 3 maven modules A,B and C.Now i am running the pom.xml of module 3 which consists of a testng.xml.This testng.xml wants to run a class of module 1 or 2 as per the user's wish(Its user interactive,so the testng changes accordingly).Now i have added the dependencies of 1 and 2 in 3. One more thing,i am running the pom.xml of module3 by runtime java command exec.
testng.xml looks like this <class name="com.org.test.mod1"></class>.And I am running Process p1=Runtime.getRuntime().exec("mvn -e install");
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would have to see the pom.xml for module C, and the mvn command output.

You mention using Runtime.exec() to run mvn. Does the build work correctly if you run mvn from a command prompt?

One other thought - have you tried adding the -U option to the mvn command? That option will print out the classpath used during testing, that might give you a clue as to what is going on.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic