New NMDEV project
This sample uses the published obfuscated combined dev.nm:nmdev-dist:1.2.6 JAR from GitHub Packages. Java 8 or later and Maven are required.
Authentication
The binary package is hosted at https://maven.pkg.github.com/nmltd/maven-packages. The binary package is public; no access to the private source repository is required. GitHub still requires authentication for Maven downloads. Create a personal access token (classic) with read:packages using GitHub's instructions.
Add the following server to ~/.m2/settings.xml (merge it into existing settings):
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0">
<servers>
<server>
<id>github-nm-packages</id>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_PACKAGES_TOKEN}</password>
</server>
</servers>
</settings>
Set those environment variables locally. Never commit a token.
License, build and run
The original starter's public trial license is included as nm.lic in the repository root. Obtain a replacement trial or commercial license from NM Dev when needed. The runtime loads this external file from the current working directory; run the commands below from the repository root. Trial validity and entitlements are enforced by NMDEV. Replace it with your own valid license when the trial expires. The license is not embedded in the application JAR. Run these commands from the repository root:
mvn -U clean verify
java -jar target/nmdev-examples-1.0.0-SNAPSHOT.jar
java -cp "target/nmdev-examples-1.0.0-SNAPSHOT.jar:target/lib/*" dev.nm.Graph
On Windows, replace the classpath colon with a semicolon. Alternatively:
mvn exec:java
mvn exec:java -Dexec.mainClass=dev.nm.Graph
HelloWorld prints A number of columns = 2. Graph prints shortest-path distances 7.0, 9.0, 11.0, 20.0, 20.0. The existing JUnit test checks the matrix column count.
Packaging produces a runnable sample JAR and copies the single combined NMDEV runtime JAR into target/lib/. Keep both when distributing the sample. The library is already combined; another assembly/shading step is unnecessary.
Public NMDEV Javadoc.