Installation¶
This guide covers various ways to install and configure Hermes in your project.
Requirements¶
- Java 17 or higher
- Maven 3.8+ or Gradle 7+
Maven Setup¶
Standard Setup¶
Add the following to your pom.xml:
<dependencies>
<!-- Core API -->
<dependency>
<groupId>io.github.dotbrains</groupId>
<artifactId>hermes-api</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Annotation processor (for @InjectLogger) -->
<dependency>
<groupId>io.github.dotbrains</groupId>
<artifactId>hermes-processor</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<!-- Core implementation -->
<dependency>
<groupId>io.github.dotbrains</groupId>
<artifactId>hermes-core</artifactId>
<version>1.0.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<annotationProcessorPaths>
<path>
<groupId>io.github.dotbrains</groupId>
<artifactId>hermes-processor</artifactId>
<version>1.0.0</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
Spring Boot Setup¶
For Spring Boot applications, use the starter:
<dependency>
<groupId>io.github.dotbrains</groupId>
<artifactId>hermes-spring-boot-starter</artifactId>
<version>1.0.0</version>
</dependency>
The starter automatically includes the API, processor, and core modules.
Kotlin Setup¶
For Kotlin projects, add the Kotlin DSL module:
<dependency>
<groupId>io.github.dotbrains</groupId>
<artifactId>hermes-kotlin</artifactId>
<version>1.0.0</version>
</dependency>
Gradle Setup¶
Standard Setup¶
Add the following to your build.gradle:
dependencies {
implementation 'io.github.dotbrains:hermes-api:1.0.0'
annotationProcessor 'io.github.dotbrains:hermes-processor:1.0.0'
runtimeOnly 'io.github.dotbrains:hermes-core:1.0.0'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Kotlin DSL (build.gradle.kts)¶
dependencies {
implementation("io.github.dotbrains:hermes-api:1.0.0")
annotationProcessor("io.github.dotbrains:hermes-processor:1.0.0")
runtimeOnly("io.github.dotbrains:hermes-core:1.0.0")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Spring Boot with Gradle¶
Dependency Overview¶
Understanding the module structure:
| Module | Purpose | Scope |
|---|---|---|
hermes-api |
Core interfaces and annotations | compile |
hermes-processor |
Annotation processor for @InjectLogger |
provided |
hermes-core |
Implementation with appenders and layouts | runtime |
hermes-spring-boot-starter |
Spring Boot auto-configuration | compile |
hermes-kotlin |
Kotlin DSL extensions | compile |
Why different scopes?
hermes-apiis needed at compile time for your codehermes-processoronly runs during compilationhermes-coreis discovered at runtime via ServiceLoader
Verifying Installation¶
Create a simple test class:
import io.github.dotbrains.InjectLogger;
@InjectLogger
public class InstallationTest extends InstallationTestHermesLogger {
public static void main(String[] args) {
InstallationTest test = new InstallationTest();
test.testLogging();
}
public void testLogging() {
log.info("Hermes is installed correctly!");
}
}
Build and run:
You should see:
Next Steps¶
- Follow the Quick Start guide
- Learn about Basic Usage
- Configure Spring Boot Integration