Building SSE Server
Background
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.
- Start by removing the META-INF/MANIFEST.MF file. This file will be regenerated, and the process fails if it already exists.
- Bring up Project Structure (Shift + Ctrl + Alt + S) and select the "Artifacts" tab.
- Remove existing definition for the sse-server by selecting the artifact and hitting the '-' icon.
- Hit the '+' icon to add a new entry and select JAR -> From modules with dependencies …. A dialog pops up.
- Type in the name of the Main class com.clueride.sse.Main, and hit OK.
- This populates the list of jars that will be extracted using the dependency definitions in the pom.xml file.
- Hit OK. This artifact is ready to generate new builds. Continue with the Steps for App Code Changes below.
Steps for App Code Changes
- Choose Build -> Build Artifacts … from the IntelliJ menu. (I've setup a hot-key combination of Shift + Ctrl + F11).
- 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.
page revision: 5, last edited: 20 Sep 2019 20:54