Setting up a project

Requirements

Java 8 (or later) is required to build and run an application based on Armeria.

Choosing the artifacts

All Armeria JARs are available in Maven Central Repository under group ID com.linecorp.armeria so that you can fetch them easily using your favorite build tool. Add the Armeria artifacts that provide the desired functionality to your project dependencies. The following is the list of major Armeria artifacts which might interest you:

Artifact ID

Description

armeria

The core library.

armeria-brave

Distributed tracing with Brave. See Zipkin integration.

armeria-bucket4j

Support Bucket4j based ThrottlingStrategy.

armeria-consul

Consul based service discovery. See Consul service discovery and Consul service registration.

armeria-dropwizard2

Provides a Dropwizard 2 Bundle around armeria-jetty9. See Using Armeria with Dropwizard.

armeria-eureka

Eureka based service discovery. See Eureka service discovery and Eureka service registration.

armeria-graphql

GraphQL service support. See Running a GraphQL service.

armeria-grpc and armeria-grpc-kotlin

gRPC client and server support. See Running a gRPC service and Calling a gRPC service.

armeria-jetty11,

Embedded Jetty 11 Servlet container. See Embedding a servlet container.

armeria-kafka

Enables sending access logs to Kafka

armeria-kotlin

Kotlin support. See Kotlin coroutines support.

armeria-logback14

Provides Logback Appender implementation that adds request information. See Logging contextual information.

armeria-oauth2

Support OAuth 2.0.

armeria-protobuf

Support Protocol Buffers in annotated service.

armeria-retrofit2

Allows using Armeria instead of OkHttp as transport layer when using Retrofit2. See Retrofit integration.

armeria-reactor3

Project Reactor plugin

armeria-resilience4j2

Support Resilience4j Circuit Breaker integration.

armeria-resteasy

Support RESTEasy integration.

armeria-rxjava3

RxJava 3 plugin

armeria-saml

SAML support

armeria-scalapb_2.12 and armeria-scalapb_2.13

Support ScalaPB for gRPC and annotated service.

armeria-spring-boot3-actuator

Spring Boot 3 Actuator integration. See Actuator support.

armeria-spring-boot3-autoconfigure

Spring Boot 3 integration. See Spring Boot integration.

armeria-spring-boot3-webflux-autoconfigure

Spring Boot 3 WebFlux integration. See Using Armeria with Spring WebFlux.

armeria-thrift0.18

Thrift 0.18 client and server support. See Running a Thrift service and Calling a Thrift service.

armeria-tomcat10

Embedded Tomcat 10 Servlet container. See Embedding a servlet container.

armeria-zookeeper3

ZooKeeper 3 based service discovery. See ZooKeeper service discovery and ZooKeeper service registration.

Setting up with a build system

You might want to use the following build file as a starting point when you set up a new project:

build.gradle
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'

repositories {
    mavenCentral()
}

dependencies {
    // Adjust the list as you need.
    ['armeria',
    'armeria-brave',
    'armeria-grpc',
    'armeria-jetty11',
    'armeria-kafka',
    'armeria-logback12',
    'armeria-retrofit2',
    'armeria-rxjava3',
    'armeria-saml',
    'armeria-thrift0.18',
    'armeria-tomcat10',
    'armeria-zookeeper3'].each {
        implementation "com.linecorp.armeria:${it}:1.27.3"
    }

    // Logging
    runtimeOnly 'ch.qos.logback:logback-classic:1.4.14'
}

Configure -parameters javac option

You can configure your build tool to add -parameters javac option as follows.

build.gradle
tasks.withType(JavaCompile) {
    options.compilerArgs += '-parameters'
}

IntelliJ IDEA

Go to Preferences > Build, Execution, Deployment > Compiler > Java Compiler and add -parameters to Additional command line parameters.

intellij javac parameters

Using Maven BOM for simpler dependency management

You can import com.linecorp.armeria:armeria-bom into your build rather than specifying Armeria versions in more than one place. See this article for Gradle and this article for Maven to learn more about what Maven BOM is and how to use it.