This is my first time with
maven. I've used ant before, though.
This is what a document which is given to me says:
1. Setup maven (this includes installing maven, and setting up maven's bin folder in path).
Now we have quite a few folders in our application and each folder represents a web application. These web applications are deployed as WAR files. So basically we use maven to build these web applications.
The document says:
2. Open command prompt, go into any web application folder, run following command: mavan clean war
Surprisingly this commands create a war file (web-application-folder-name.war) in target folder, the target folder is a folder in web application folder. For example, if I have a web application folder c:/application/webapp1 and I run this command from this location, I'll eventually have a war file named webapp1.war in c:/application/webapp1/target folder.
After this step I get this war file from here and deploy it on server.
I am able to do that as document suggested but have no clue what's happening behind the scene.
Let's assume maven clean war buids and generate war file for the folder from which this command was ran. Where did I define that it should place generated war file in target folder? Or it's always the case is. I am just concerned how it can work without any errors. If I run maven clean jar command, it creates jar file out of it – isn’t that folder supposed to stop it doing that. How can that web application be built as a JAR file? So many questions.