Simply copy the main jar where you want with the "libs" folder at the same level. It works with Java 11!!
Just a note, you can include jsons with the followint syntax, using single or double quotes The quotes are used to avoid messing with json formatting
The content of the target file will replace AS-IS the include statement
"#include:/absolute/path/file.json"
"#include:relative/to/external/json/path/file.json"
Prepare a basic configuration in an "external.json" file in the same dir of the Jar
The name for which the server will respond
[{ "id":"global",
"localAddress":"www.local.test",
The http/s configuration, this will be generated at runtime. For the https certificates see the Https configuration page
[{ "id":"https",
"active":true,
...},
{ "id":"http",
"active":true,
...},
{ "id" : "ssl",
"cname":"C=US,O=Local Development,CN=local.org",
"domains" : [{
"id" :"a",
"address":"*.local.test"},
{
"id" :"b",
"address":"local.test"},
You have two options. Hosts file or the embedded dns server. See the DNS page for further info
Under Windows run notepad as administrator and add the following at the end of "C:\Windows\System32\drivers\etc\hosts" file, under *nix "/etc/hosts"
127.0.0.1 www.local.test
First you need to enable the local dns on external.json file. Remind that this approach probably wont work if you are running a VPN client! It does not work (for me) with OpenVPN client and GlobalProtect.
[{ "id":"dns",
"active": false,
Then run the following command
java "-Dloader.path=/start/services/answering/libs" \
-Djdk.tls.acknowledgeCloseNotify=true \
-Dloader.main=org.kendar.Main \
-jar app-2.1.3.jar \
org.springframework.boot.loader.PropertiesLauncher
The loader.main is a specific Spring Boot variables to force the loading of local application.properties file together with the PropertiesLauncher.
The loader path (that must be a full path) tells the application where to find the external plugins to load
The jdk.tls.acknowledgeCloseNotify, is a fix for a specific problem with TLS that can be encontered on several JDKs ( see on Stackoverflow )
And go with any browser on http://www.local.test/api/health
You should see then an "OK" text
You can then install the root certificate on the machine, first list the certificate you need going on http://www.local.test/api/certificates that will return a list of the available formats. The encrypted key pwd is "test":
[
"ca.der",
"ca.encrypted.key",
"ca.key"
]
You can then download your preferred one and install on the OS and on the Browser downloading them from http://www.local.test/api/certificates/NAME for example, then yout can download the certificae file and install it as trusted root CA.
For example on Windows you can download the der http://www.local.test/api/certificates/ca.der. Then you can unzip the file and install it as trusted root CA.
On java you can download the der http://www.local.test/api/certificates/ca.der. And import it into the main keystore. For the ham Docker images this is not needed, since they already contains everything.
keytool -import -trustcacerts -alias answeringMachineCa -file ca.der -cacerts -storepass changeit
For the browser you can follow the various browsers instruction and install as trusted root CA.
Now you can browse to https://www.local.test/api/health (mind the HTTPS! ) and you will not receive any security warning.