Using maven instead of ant with SPRING, deploying and structure
I have a spring project and using ANT to compile/deploy my war to Tomcat. So basically it just creates a war file and moves it to tomcat folder.
folder structure is this:
Spring -src ALL MY SRC (JAVA) files -war -WEB-INF -jsp -lib ALL MY LIBRARIES -properties web.xml spring-servlet.xml -META-INF build.xml pom.xml // putting my pom.xml here
With ant I download all my libraries manually. Now as it seems, maven downloads all libraries automatically, thanks to pom.xml. Questions/problems:
- Must I change my folder structure with maven?
- Will maven include all downloaded libs to WAR? Is that default?
- When maven downloads its WARS, can it put all libraries to WEB-INF/lib? How?
- Does it make sense what I am doing, if no, then why?
Have few questions, because I have never ever used maven.
- Yes better change the structure, see the maven site. It saves a bit of hassle, should you start using maven-plugins with complex things like using XSLT to generate java sources. Also IDE support might be better. Like: src/main/java, src/test/java, src/main/resources.
- Yes. Automagically.
- Yes otherwise you should use Ivy with ant.