Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

maven surefire junit hibernate dependency issue

 
Robert Hogan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am converting a build procedure from ant to maven and have a set of junit test the exercise a mysql database via a hibernate layer.

The tests are set up to run via the surefire plugin.

When I run I get errors during my hibernate session factory setup (which runs out of a @Before method). I resolved the errors by adding antlr-runtime and javaassist artifacts to my dependency tree. This , however , puzzles me to no end as already have hibernate-core on my list of dependencies.

By my way of thinking I should not have had to add the secondary dependencies; in fact, our whole motivation for moving to maven is to eliminate these kinds of problems .

Anyone ???

Thanks
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No solution for you offhand, but here is what you can do to get to the root cause of this issue. I've done this quite often...

First, run the Maven build you currently have passing the -X option. This will generate a lot of output so you should redirect stdout and stderr to a file. Among the information available will be the classpath built for running the unit tests. And actually, you can see that same classpath by examining the manifest in the JAR file located in the target/surefire directory.

Now do the same thing with your prior pom.xml. What you are looking for is things that are different. That should bring something to mind which will lead to a solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic