Java Client for the Hetzner Cloud API, as well as the new "Hetzner OneAPI" https://sinuscosinustan.grebedoc.dev/hetznercloud-java/
Find a file
Tan Siewert 951ed1529e
Some checks failed
ci/woodpecker/tag/release Pipeline failed
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/build/2 Pipeline was successful
Bump version to v5.0.3
* **Tan Siewert**
    * Migrate to Codeberg

*Released by Tan Siewert <tan@siewert.io>*

Signed-off-by: Tan Siewert <tan@siewert.io>
2026-02-17 22:22:56 +01:00
.woodpecker Bump version to v5.0.3 2026-02-17 22:22:56 +01:00
src error: add new must_be_unassigned code 2026-02-11 19:17:12 +01:00
.gitignore gitignore: ignore .classpath and .project 2023-04-24 18:27:19 +02:00
CHANGELOG.md Bump version to v5.0.3 2026-02-17 22:22:56 +01:00
checkstyle.xml Migration from Spring RestTemplate to OkHttp (#75) 2022-07-27 11:14:57 +02:00
LICENSE.md Change namespace to io.github.sinuscosinustan 2025-02-10 17:01:14 +01:00
pom.xml Bump version to v5.0.3 2026-02-17 22:22:56 +01:00
README.md Bump version to v5.0.3 2026-02-17 22:22:56 +01:00
renovate.json chore(config): migrate config renovate.json 2025-10-07 17:19:41 +00:00

Hetzner Cloud API for Java

status-badge

Simple Java client for the Hetzner Cloud API.

Compile

This project uses Maven as build automation.

Just run mvn clean install to install it in the local Maven repository cache.

How to use

Maven

Dependency:

<dependencies>
    <dependency>
        <groupId>io.github.sinuscosinustan</groupId>
        <artifactId>hetznercloud-api</artifactId>
        <version>5.0.3</version>
    </dependency>
</dependencies>
Gradle

Put this in the build.gradle file of the project:

repositories {
    mavenCentral()
}

dependencies {
    implementation "io.github.sinuscosinustan:hetznercloud-api:5.0.3"
}
kotlin-dsl
dependencies {
    implementation("io.github.sinuscosinustan:hetznercloud-api:5.0.3")
}

Requirements

  • Java 17 or higher
  • Maven 3.6.0 or higher

How to run tests

This project has unit tests, as well as integration tests.

Unit Tests (Default)

mvn test

Integration Tests

Integration tests require an API Token for the Hetzner Cloud. Set the API token as an environment variable called HCLOUD_TOKEN.

To obtain an API key, please see the official API documentation.

HCLOUD_TOKEN="${api_key}" mvn test -Pintegration-tests

Code Quality

Checkstyle

Checkstyle runs automatically during compilation:

mvn compile

Code Coverage (JaCoCo)

Generate code coverage reports:

mvn test

View the HTML report at target/site/jacoco/index.html

JavaDocs

The JavaDocs are available here

Dependencies

The following dependencies were used in this project: