File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven-execute java main class before test phase

 
Raghavendra K Chunduri
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to execute a java class before my unit tests run in the project.Is there any way to do this ?

executing java main class in pre-integration-phase is not executing my java class before the maven test phase.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What plugin are you using to run the Java class? The Exec plugin? Could you post your plugin description from the pom.xml?

Also, you could try running with the -X option. The plugin should give you more information about what it is doing. And -X also caused Maven to dump the build plan, make sure your plugin's execution appears in the build plan.

Finally, if you want you class to run before unit tests, you have to set the plugin to run during the test-compile phase; that's the phase immediately before the test phase which is when the unit tests run.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic