Jetty Run War Using only command line

前端 未结 5 601
梦谈多话
梦谈多话 2020-12-22 23:48

Is it possible to use only the command line to Run jetty with only a specified war file and Context Path.

Something like :

         


        
5条回答
  •  攒了一身酷
    2020-12-23 00:19

    I've written a tiny command line app / Maven archetype which works like how I thought this all should have in the first place. The bootstrap app lets you launch your servlet container of choice (Jetty, Tomcat, GlassFish) by just passing it the path to the WAR and your port.

    Using Maven, you can create and package your own instance of this simple app:

    mvn archetype:generate \
        -DarchetypeGroupId=org.duelengine \
        -DarchetypeArtifactId=war-bootstrap-archetype \
        -DarchetypeVersion=0.2.1
    

    Then you launch it like this:

    java -jar bootstrap.jar -war myapp.war -p 8080 -c /myapp --jetty
    

    Here's the source for the utility and the archetype: https://bitbucket.org/mckamey/war-bootstrap

提交回复
热议问题