Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.52 KB

File metadata and controls

49 lines (35 loc) · 1.52 KB

Java OR-Tools Maven Example

Sample project explaining how to use Google OR-Tools in a maven project that can be executed on the Nextmv platform.

Usage

Java apps 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.

References