Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Latest commit

 

History

History
53 lines (39 loc) · 1.74 KB

README.md

File metadata and controls

53 lines (39 loc) · 1.74 KB

Nextmv Java template

This template helps you writing your own optimization model in Java. It contains several files to easily deploy the model to the Nextmv platform.

Usage

Java templates in Nextmv require a main.jar as an entry point. Running the following command will generate a main.jar in the root direcotry of the project.

mvn package

After that you can run the main.jar file with the following command:

java -jar main.jar --input input.json

You can also push the main.jar file to the Nextmv Cloud and run it remotely. Take a look at the documentation on how to deploy and run an app in the Nextmv Cloud.

Mirror running on Nextmv Cloud locally

Pre-requisites: Docker needs to be installed.

To run the application locally in the same docker image as the one used on the Nextmv Cloud, you can use the following command:

mvn package && cat input.json | docker run -i --rm \
-v $(pwd):/app ghcr.io/nextmv-io/runtime/java:latest \
java -jar /app/main.jar

You can also debug the application by running it in a Dev Container. This workspace recommends to install the Dev Container extension for VSCode. If you have the extension installed, you can open the workspace in a container by using the command Dev Containers: Reopen in Container.

Next steps

  • Open main.jar and start writing the model in Java.
  • Further documentation, guides, and API references about custom modeling and deployment can also be found on our blog and on our documentation site.
  • Need more assistance? Send us an email!