Building SSE Server


The SSE server is deployed in a single Jar that contains the Grizzly server, the application, and all the necessary libraries. IntelliJ supports bundling the App Code and its dependent jars into a single "uber jar". This describes how to assemble that jar.

There are two paths:

  • Whenever the Application Code is built, the app changes are compiled and bundled using an existing Artifact definition.
  • Whenever the Library Dependencies change, it is easiest to rebuild the Artifact definition and use that to build the jar.

Steps for Library Dependency (pom.xml) Changes

This includes version changes.

  1. Start by removing the META-INF/MANIFEST.MF file. This file will be regenerated, and the process fails if it already exists.
  2. Bring up Project Structure (Shift + Ctrl + Alt + S) and select the "Artifacts" tab.
  3. Remove existing definition for the sse-server by selecting the artifact and hitting the '-' icon.
  4. Hit the '+' icon to add a new entry and select JAR -> From modules with dependencies …. A dialog pops up.
  5. Type in the name of the Main class com.clueride.sse.Main, and hit OK.
  6. This populates the list of jars that will be extracted using the dependency definitions in the pom.xml file.
  7. Hit OK. This artifact is ready to generate new builds. Continue with the Steps for App Code Changes below.

Steps for App Code Changes

  1. Choose Build -> Build Artifacts … from the IntelliJ menu. (I've setup a hot-key combination of Shift + Ctrl + F11).
  2. From the menu, choose Build. This kicks off the compilation and re-packaging of jars. (If desired, Clean may be run before Build)

The resulting jar is placed on the path ${project_root}/out/artifacts/sse_server_jar/sse-server.jar.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License