Skip to content

Added ability to run the war file from the commandline by embedding Jetty#62

Open
boxheed wants to merge 7 commits into
Confluex:masterfrom
boxheed:master
Open

Added ability to run the war file from the commandline by embedding Jetty#62
boxheed wants to merge 7 commits into
Confluex:masterfrom
boxheed:master

Conversation

@boxheed

@boxheed boxheed commented May 5, 2014

Copy link
Copy Markdown

Hi Mike,

Thanks for the brilliant work on Zuul, it fills a part of the jigsaw with centralized configurations that is missing. Anyway I like to run my apps on the command line rather than putting them in a container so thought you might like this tweak to the app so that it can run using an embedded Jetty container in the war file so that you can run it by doing java -jar zuul.war.

I followed these instructions here for adding Jetty support to Zuul: http://uguptablog.blogspot.co.uk/2012/09/embedded-jetty-executable-war-with.html.

The following is a summary of the changes:

  • Update pom to package the war file as an executable using Jetty so it can be run as java -jar zuul.war. Note that the Jetty version isn't quite the latest.
  • Moved taglibs and tagdirs to a different location in the war that Jetty expects them to be.
  • Changed Spring application context to resolve the zuul-data-config.properties and ldap.properties from a file location rather than the classpath when running using Jetty. Still defaults to classpath when run as the war file within Tomcat.
  • The server port is configurable on the command line by setting the System property server.port e.g. java -Dserver.port=9080 -jar zuul.war. Default is for port 8080.
  • The file based config location is configurable via the command line by setting the System property conf.location and uses Spring resource prefixes e.g. java -Dconf.location=file:/home/zuul/

Let me know what you think

Cheers

Andy

@mcantrell

Copy link
Copy Markdown
Collaborator

Thanks Andrew. This is very useful.

I've merged your request into a jetty-boot branch for now. There is still some cleanup to do in order to get this to work in Tomcat 7 due to the JSTL changes. I'll sort that out and update the wiki docs before merging back into master and cutting a 1.5.2 release.

@mcantrell mcantrell added this to the 1.5.2 - Jetty Boot milestone May 6, 2014
@boxheed

boxheed commented May 9, 2014

Copy link
Copy Markdown
Author

Let me know if there is anything I can do to help.

Cheers

Andy

@psmith

psmith commented Oct 28, 2015

Copy link
Copy Markdown
Contributor

I'm going to take a look into this further after the rebranding and updating Spring, etc. I'd like this feature to for demo's, and running it in Docker, or via Vagrant and Ansible. I need to get all the various app servers setup with java7 and 8 in an automated way to make regression testing such changes easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants