My other choice is to create A runnable jar (mvn assembly: single) to start the server, but I need to adjust the configuration to provide static content src/main/webapp and find web.xml.
I also read about “available Running war” message. This may avoid the src/main/webapp problem because these files are already laid out in the warfile. However, I don’t know how to do it.
I can also stick to mvn jetty: run, but it doesn’t seem to be the best choice, because production deployment was tied to the code instead of a separate jar.
Any opinions on the best way or pros and cons of these different methods? Am I missing some options?
I need to deploy the production version of the web application. So far, I have been testing it with mvn jetty: run. I have used the actual jetty installation before, but when you want to have multiple wars on the same web server When, they seem to be necessary. In some ways, this is the clearest (mvn package and copy it).
My other option is to create a runnable jar ( mvn assembly: single), but I need to adjust the configuration to provide static content src/main/webapp and find web.xml.
I also read about “runnable war”. This The src/main/webapp problem may be avoided because these files are already laid out in the warfile. However, I don’t know how to do it.
I can also stick to mvn jetty:run, but it doesn’t seem to be The best choice, because production deployment is tied to the code instead of a separate jar.
Any opinions on the best way or pros and cons of these different methods? Am I missing some options?
The simple and easy-to-use jetty-console-maven-plugin is easy to use and works well. When you run the mvn package, you will get two wars – One field is executable. java -jar mywar.war –help gives the usage, it allows some configuration (port etc.).