Hi All, I've been using maven for sometime, but i always used it only for building artifact and to deploy i used ant, but whenever someone asked me why not use maven for both build and deploy to servers i couldn't really tell them why?
Here is my requirement we have different env like DEV,SIT,UAT and PROD and now i use maven to build the code at DEV stream in clearcase, at the end of successful compilation i create a ear using maven ear plugin create a ear and store it some central location. for this i use a command mvn -e clean package. After this whenever there is a request to deploy the ear file at different times i take the ear file from this central location and deploy it to different environment without rebuilding again, so for this purpose initially i tried adding the my server related plugin at install phase then tried running mvn -e clean install but whenever i did maven goes thru full life cyle again like compiling,packaging again, but i didn't want on this way i just want to take the ear file already created and just run that "install" phase, i tried the same in different phase and tried to run just that goal, but never got it working. so finally i decided my self that this is not possible unless we want to go thru full lifecyle (compile,package,deploy) every time, so moved to ant it was very easy with ant. But time to time i do see lot of emails on this forum asking about failure in deployments, is everyone is doing full lifecycle every time ? no one just compile and package only one time then stage the artifact then deploy it from there using maven? is there something i'm missing here ? Any one has any thought on this?