MicroProfile Starter has generated this MicroProfile application for you containing some endpoints which are called from the main application (see the service-a
directory)
The generation of the executable jar file can be performed by issuing the following command
mvn clean package
This will create an executable jar file demo.jar within the target maven folder. This can be started by executing the following command
java -jar target/demo.jar
Have a look at the TestSecureController class (main application) which calls the protected endpoint on the secondary application. The ProtectedController contains the protected endpoint since it contains the @RolesAllowed annotation on the JAX-RS endpoint method.
The TestSecureController code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs.
A type safe invocation of HTTP rest endpoints. Specification here
The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean.