How to integrate MicroProfile-Rest-Client into an application
The MicroProfile-Rest-Client API and it’s implementations are supplied via Maven Dependencies, although these dependencies can be provided in different ways, depending on the used application runtime. The following sections explain how MicroProfile-Rest-Client is supplied by different application runtimes. MicroProfile-Rest-Client depends on MicroProfile-Config to provide the configurations for the REST clients; consequently MicroProfile-Config is a necessary dependency.
Integration with Wildfly/EAP
The cited dependencies have to be added in provided scope. No runtime dependencies are necessary, because Wildfly/EAP has MicroProfile capabilities already preinstalled as JBoss modules.
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-rest-client-api</artifactId>
<version>${version.microprofile.rest.client}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${version.microprofile.config}</version>
<scope>provided</scope>
</dependency>
Integration with Thorntail Microservice
Thorntail provides a Maven Bill-of-Materials (bom) which includes the Thorntail fraction for MicroProfile-Rest-Client and MicroProfile-Config.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom</artifactId>
<version>${version.thorntail}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>microprofile-config</artifactId>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>microprofile-restclient</artifactId>
</dependency>
</dependencies>
Integration with Quarkus Microservice
Quarkus, like Thorntail, provides a Maven-BOM which provides all necessary Extensions supported by the specific Quarkus version.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- MicroProfile-Config is standard way of configuring
Quarkus, so there is no need for a dependency -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
</dependency>
</dependencies>