I am going to ship out the first version of webapp base on Javalite framework. Thanks the framework, it makes the developing rapidly :). Here are some goals in my production env.
- I would like to use
maven-assembly-plugin
to assemble all dependencies into one jar, named likemyapp-with-dependencies.jar
- I'd like to run the webapp using command line:
java -jar myapp-with-dependencies.jar
, so that I can create daemon service formyapp
I've checked all sample apps of Javalite repo on github, Below lists the entry Main.java
in development env
public class Main {
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
WebAppContext webapp = new WebAppContext("src/main/webapp", "/"); // <- should package as war in production?
webapp.addAliasCheck(new AllowSymLinkAliasChecker());
server.setHandler(webapp);
server.start();
server.dumpStdErr();
server.join();
}
}
new WebAppContext("src/main/webapp", "/");
only works on development mode? and how to change it to production mode?
The question may be related to embedded-jetty. If you have any experiences on shipping Javalite on production env, could you like to share it ? Thanks!