Quarkus micro-profile starter using Gradle / Maven build tools.
getting started
./mvnw -Pdocker docker:start
#./mvnw process-resources flyway:migrate
./mvnw compile quarkus:dev
./mvnw -Pdocker docker:stop
add rest-client extension
./mvnw quarkus:add-extensions -Dextensions="quarkus-smallrye-rest-client"
or directly in pom.xml
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-rest-client</artifactId>
</dependency>
</dependencies>
declare proxy interface: HelloRestClient.java
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
@Path("/")
@RegisterRestClient
public interface HelloRestClient {
@GET
@Produces(APPLICATION_JSON)
String getHello();
}
usage
@Inject
@RestClient
HelloRestClient restClient;
// ...
var greeting = restClient.getHello();
NOTE: This project has been based on GitHub: daggerok/main-starter