Skip to main content

Setting up a project

Requirements

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

tip

Use Java 19 (or later) if you are a contributor who tries to build Armeria itself. See CONTRIBUTING.md for more information.

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 IDDescription
armeriaThe core library.
armeria-braveDistributed tracing with Brave. See Zipkin integration.
armeria-bucket4jSupport Bucket4j based ThrottlingStrategy.
armeria-consulConsul based service discovery. See Consul service discovery and Consul service registration.
armeria-dropwizard2Provides a Dropwizard 2 Bundle around armeria-jetty9. See Using Armeria with Dropwizard.
armeria-eurekaEureka based service discovery. See Eureka service discovery and Eureka service registration.
armeria-graphqlGraphQL service support. See Running a GraphQL service.
armeria-grpc and armeria-grpc-kotlingRPC client and server support. See Running a gRPC service and Calling a gRPC service.
armeria-jetty11Embedded Jetty 11 Servlet container. See Embedding a servlet container.
armeria-kafkaEnables sending access logs to Kafka
armeria-kotlinKotlin support. See Kotlin coroutines support.
armeria-logback14Provides Logback Appender implementation that adds request information. See Logging contextual information.
armeria-oauth2Support OAuth 2.0.
armeria-protobufSupport Protocol Buffers in annotated service.
armeria-retrofit2Allows using Armeria instead of OkHttp as transport layer when using Retrofit2. See Retrofit integration.
armeria-reactor3Project Reactor plugin
armeria-resilience4j2Support Resilience4j Circuit Breaker integration.
armeria-resteasySupport RESTEasy integration.
armeria-rxjava3RxJava 3 plugin
armeria-samlSAML support
armeria-scalapb_2.12 and armeria-scalapb_2.13Support ScalaPB for gRPC and annotated service.
armeria-spring-boot3-actuatorSpring Boot 3 Actuator integration. See Actuator support.
armeria-spring-boot3-autoconfigureSpring Boot 3 integration. See Spring Boot integration.
armeria-spring-boot3-webflux-autoconfigureSpring Boot 3 WebFlux integration. See Using Armeria with Spring WebFlux.
armeria-thrift0.18Thrift 0.18 client and server support. See Running a Thrift service and Calling a Thrift service.
armeria-tomcat10Embedded Tomcat 10 Servlet container. See Embedding a servlet container.
armeria-zookeeper3ZooKeeper 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.35.0"
}

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

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.

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.

Like Armeria?
Star us ⭐️

×