A fat jar is a jar file which includes all the dependencies in one fat (uber) jar. This mode of creating a fat jar and running it in a Java process is also referred to as server-less execution.
- See also; MSF4J Interceptor Service - Deployable Jar mode
- See also; MSF4J Interceptor Service - OSGi mode
Your POM can inherit from msf4j-service. See details here.
The pom should include the following plugins
<build>
<plugins>
<plugin>
<groupId>org.skife.maven</groupId>
<artifactId>really-executable-jar-maven-plugin</artifactId>
<version>${maven.reallyexecutablejarplugin.version}</version>
<configuration>
<programFile>restinterceptor</programFile>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>really-executable-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The pom should include the following properties
<properties>
<microservice.mainClass>org.wso2.msf4j.samples.fatjarinterceptorservice.Application</microservice.mainClass>
</properties>
From this directory, run
mvn clean install
Use following command to run the application
java -jar target/fatjar-interceptor-service-\<version>.jar
Use following cURL command.
curl http://localhost:8080/interceptor-service/service-name
You should get a successful response if everything worked fine.
Use following cURL command.
curl --insecure https://localhost:8444/interceptor-service/service-name
You should get a successful response if everything worked fine.