• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

maven doenst see junit ?

 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys :

This is a very odd issue.......

For some reason, maven doesn't see junit. Its defined in the dependencies of my pom, however. Its giving me a "junit.framework" package doesn't exist, as well as errors which indicate that the assertEquals and other junit staples are undefined ................. any thoughts ?

 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The junit dependency declaration looks OK to me. In which build phase are you getting the errors? You do not, by any chance, have any unit tests in src/main/java?

If this doesn't help, post the build output.
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually might... Thanks! I think I had a standalone unit test in that trunk

So... Maven doesn't add junit to the whole class path?
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "scope" for junit is "test". This means that junit will be include in the classpath only when compiling code within src/test/java and when running the unit tests. junit will not be in the classpath when compiling code win src/java/main.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic