-
Notifications
You must be signed in to change notification settings - Fork 14
How to build a war file for your project
You can build a war file from your Conjure project with the included leiningen-war leiningen plugin. If you’ve created a new Conjure project, all supporting files are already there. If you’re upgrading an older project, you’ll need to copy over some support files.
Once you update to Conjure 0.8 leiningen-war will be included in your project. More information on including leiningen-war can be found at: leiningen-war
The command “lein uberwar” will create a working war file which you can drop into your server.
If you are updating project created with a previous version of Conjure, you’ll need to do everything you would do with a new project, but also add a web.xml file to your src directory. The web.xml file looks like: http://github.com/macourtney/Conjure/blob/master/conjure_script/resources/new_project/src/web.xml
War file support with Conjure projects has only been tested with apache tomcat. If you have any issues or find that everything does work on another server, let us know.
When you drop a war file into a tomcat server, you can access it by pointing your browser at a specific path. For example, if you drop the hello_world.war file in to your tomcat server which is running on localhost:8080, you can access the pages of the war file at http://localhost:8080/hello_world
Unfortunately, Conjure is not set up to work in this environment, and you’ll have some issues. Conjure will be able to find all of you pages if you pass them as subdirectories of hello_world. For example, the home/index page can be found at http://localhost:8080/hello_world/home/index. However, the stylesheet will not reference “hello_world”. Therefore, the rendering of the page will be incorrect. To fix this issue for your specific project, you must update all of the references to other files in all of the stylesheet css files.
Alternatively, if you’re using a default installation of Apache Tomcat, you can simply rename the war file to ROOT.war. Note: the name is case sensitive.