开发者

maven deploying to server

开发者 https://www.devze.com 2023-03-27 14:56 出处:网络
how would i get maven to deploy my app for me. i want to be able to type mvn deply:devserver (or something like that) and have it do the following things

how would i get maven to deploy my app for me.

i want to be able to type

mvn deply:devserver (or something like that) and have it do the following things

SCP all dependency jars to the remote devserver/var/lib/tomcat6/shared/company folder

SCP the war file to the remote devserver/var/lib/tomcat6/webapps folder

and since i can already hear the statements/questions "why are you doing it like this, you can just build the war with dependencies in it" bla bla bla i will answer. this server is going to be running about 35 different war files (be gentle i开发者_如何学C inherited this project) all using the same dependencies so i don't see the point of having the tomcat classloader loading the same 50 or so libraries 35 times. id rather have tomcat load them on startup and share them with the webapps.

and NO, manager is not installed on this instance of tomcat so please don't go there. security guys wont let us install the management console on a publicly visible server so all the deployments must be via SCP file copies.

i could do this in about 5 minutes with ant and i havn't eliminated the possibility of simply writing a shell script to do it but i would like to give maven a chance first.


You should script the 'deploy' of the code to the server. If you choose to use Ant, do it, but Maven is not the right tool for this job.

The Maven 'deploy' goal is used to deploy built artifacts to a repository server for other projects to be able to download as dependencies. It is not the 'deploy' you are thinking of.

If you really need this done by Maven though, there is a maven ant plugin which lets you run Ant tasks in Maven and you could bind this to your deploy step. I would advise against this though because it very much goes against the conventions of using Maven as a build tool.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号