问题
I am trying to build a war from dropwizard app and deploy. I could successfully run the jar and access my rest services.
Has anybody created and successfully deployed a war from dropwizard app? What is the right approach for it?
回答1:
Dropwizard is designed to run as a JAR, not as a WAR file.
回答2:
It certainly goes against what Dropwizard is about and isn't exactly recommended, but if you find yourself in an environment where this is forced upon you then this might also be an option: https://github.com/twilio/wiztowar
It looks similar to the library referenced in this answer.
WizToWar - Have your cake and eat it too
WizToWar is a simple library that enables a Dropwizard service to also be deployable in a WAR container such as Tomcat.
By following the steps in the usage section below you will be able to create both a Dropwizard jar and a WAR of the same service.
回答3:
It makes a lot of sense to roll out your application as a jar, but sometimes you are bounded by company/enterprise standards and you're obliged to deploy on a particular application server in production. In this case https://github.com/rvs-fluid-it/wizard-in-a-box becomes handy. Feel free to test it. I welcome feedback.
来源:https://stackoverflow.com/questions/17986935/how-to-create-a-war-from-dropwizard-app