This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi guys : I've been using maven2 to manage dependencies for a while, it works well. I wanted to expand my use of maven to do more than just dependency management.... That is, I want it cover my deployment and testing needs.
However, I was confused about 3 things (I'm using the M2 plugin in eclipse, which very nicely merges maven into the natural eclipse build process, making it somewhat easy to be an ignorant maven user).
1) I never quite know what Maven means by "<packaging>jar</packaging>" .... Is it actually creating a Jar ? If so where is that jar being stored ? I'm also wondering the same thing for the war packaging command ... where is the "war" going ?
2) Is there a way to directly invoke JUnit tests from Maven by simply editing the Pom file ? I know that you can add some JUnit details using the
using the <build> tag, but I'm not sure how this relates, sequentially, to the overall maven compilation process.
Any suggestions on a good, project based maven / eclipse / junit tutorial would be nice also.
The maven "package" goal automatically runs unit tests, if you have any defined in your project. You need to add a junit dependency in "test" scope in order to select the Junit jar needed to run the tests, but it's mostly Just Magic.
You should put source for JUnit tests in the src/test/java subdirectory tree.