Setting up a project
Table of contents
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 |
---|---|
| The core library. |
| Distributed tracing with Brave. See Zipkin integration. |
| Support Bucket4j based
|
| Consul based service discovery. See Consul service discovery and Consul service registration. |
| Provides a Dropwizard 2 Bundle around |
| Eureka based service discovery. See Eureka service discovery and Eureka service registration. |
| GraphQL service support. See Running a GraphQL service. |
| gRPC client and server support. See Running a gRPC service and Calling a gRPC service. |
| Embedded Jetty 11 Servlet container. See Embedding a servlet container. |
| Enables sending access logs to Kafka |
| Kotlin support. See Kotlin coroutines support. |
| Provides Logback |
| Support OAuth 2.0. |
| Support Protocol Buffers in annotated service. |
| Allows using Armeria instead of OkHttp as transport layer when using Retrofit2. See Retrofit integration. |
| Project Reactor plugin |
| Support Resilience4j Circuit Breaker integration. |
| Support RESTEasy integration. |
| RxJava 3 plugin |
| SAML support |
| Support ScalaPB for gRPC and annotated service. |
| Spring Boot 3 Actuator integration. See Actuator support. |
| Spring Boot 3 integration. See Spring Boot integration. |
| Spring Boot 3 WebFlux integration. See Using Armeria with Spring WebFlux. |
| Thrift 0.18 client and server support. See Running a Thrift service and Calling a Thrift service. |
| Embedded Tomcat 10 Servlet container. See Embedding a servlet container. |
| 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:
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.31.3"
}
// Logging
runtimeOnly 'ch.qos.logback:logback-classic:1.5.12'
}
Configure -parameters
javac option
You can configure your build tool to add -parameters
javac option as follows.
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.