When using Spring and Maven, what is the best way to deploy the code to the server?

后端 未结 1 1426
猫巷女王i
猫巷女王i 2021-01-19 21:07

I have a project that uses Spring. Every time I deploy, I run the maven goal \"package\", which runs all the tests and creates the war file. Then I manually use an ftp progr

1条回答
  •  悲哀的现实
    2021-01-19 21:53

    First of all you could avoid manual ftp copies by using the Maven Deploy plugin. You can find an how-to to deploy projects over ftp at this URL:

    http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

    Second point is a question about your project: is your WAR size normal?
    I've heard of configurations that embedded superfluous jar in order to avoid the problem of META-INF/spring.handlers overwriting when building the final jar. If you're in this situation, you might be interested by this too:

    http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html

    0 讨论(0)
提交回复
热议问题