Deploying via Local Server

Last updated on 16th July 2024

If you have an existing local server that you wish to deploy on your only core requirement is Java 8+ to be installed on the machine and ensure that you have proper permissions for both executing jar files or the necessary scripts, as well as being able to access any defined output/logging/scenario/input folders or URL's as defined in your properties.

Building using Maven

The first step is to make a few changes to your pom.xml (if not pulling from the quickstart repo). Make sure you add the jodatime and junit versions to your properties section.

pom.xml

<properties>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
  <jodatime.version>2.10.1</jodatime.version>
  <junit.version>5.3.2</junit.version>
</properties>

You will then want to add the jodatime and junit dependencies to the section starting with ''

previous dependency used junit, this has been replace with the junit-jupiter-api.

pom.xml

<dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>${jodatime.version}</version>
</dependency>

Finally you will add the plugins for assembling and dockerize-ing the project.

pom.xml

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <version>3.2.1</version>
  <executions>
    <execution>
    <phase>package</phase>
    <goals>
      <goal>shade</goal>
    </goals>
    <configuration>
      <shadedArtifactAttached>true</shadedArtifactAttached>
      <shadedClassifierName>allinone</shadedClassifierName>
      <artifactSet>
        <includes>
          <include>*:*</include>
        </includes>
      </artifactSet>
      <transformers>
        <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>reference.conf</resource>
        </transformer>
        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <main-Class>Main</main-Class>
        </transformer>
      </transformers>
    </configuration>
    </execution>
  </executions>
</plugin>

Once you have added the Maven Shade plugin you will be able to run the command mvn clean compile package -s settings.xml

This will create a large jar file that contains all dependencies (the file size should be around 100-200mb). This jar file can run from the command line or any script as java -jar simudyne-model-1.0-SNAPSHOT-allinone.jar (the name of the jar is related to your pom.xml name).

From here you'll either want to install your license file on the intended development environment as described on the Access page, or optionally rename the file to licenseKey (no extension) and include alongside with your simudyneSDK.properties file which should be placed in the same root as the jar file, or where the script is calling from.

If you get a connection reset error, or if your log displays only accessible locally you need to update your property file. Set nexus-server.hostname = 0.0.0.0. If you use the default property file (simudyneSDK.properties), simply remove the # that comments the line.