aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven doenst see junit ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven doenst see junit ? " Watch "maven doenst see junit ? " New topic
Author

maven doenst see junit ?

jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
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

Joined: May 14, 2008
Posts: 5845
    
    7

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.


JBoss In Action
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
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

Joined: May 14, 2008
Posts: 5845
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven doenst see junit ?