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-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-grpc

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

armeria-jetty9

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

armeria-kafka

Enables sending access logs to Kafka

armeria-kotlin

Kotlin support. See Kotlin coroutines support.

armeria-logback

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

armeria-retrofit2

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

armeria-rxjava3

RxJava 3 plugin

armeria-saml

SAML support

armeria-spring-boot2-autoconfigure

Spring Boot 2 integration

armeria-spring-boot2-webflux-autoconfigure

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

armeria-thrift0.13

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

armeria-tomcat9

Embedded Tomcat 9 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-jetty9',
    'armeria-kafka',
    'armeria-logback',
    'armeria-retrofit2',
    'armeria-rxjava3',
    'armeria-saml',
    'armeria-thrift0.13',
    'armeria-tomcat9',
    'armeria-zookeeper3'].each {
        implementation "com.linecorp.armeria:${it}:1.1.0"
    }

    // Logging
    runtimeOnly 'ch.qos.logback:logback-classic:1.2.3'
    runtimeOnly 'org.slf4j:log4j-over-slf4j:1.7.30'
}

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 paramters.

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.