Java Library for the Hetzner Cloud API - NOW ON CODEBERG
Hetzner Cloud API for Java ==========================
THE CODE NOW LIVES ON CODEBERG!
Simple Java client for the Hetzner Cloud API.
Important message about this project here
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:
<pre><code class="lang-xml"><dependencies> <dependency> <groupId>io.github.sinuscosinustan</groupId> <artifactId>hetznercloud-api</artifactId> <version>5.0.2</version> </dependency> </dependencies></code></pre>
Gradle
Put this in the build.gradle file of the project:
<pre><code class="lang-groovy">repositories { mavenCentral() }
dependencies { implementation "io.github.sinuscosinustan:hetznercloud-api:5.0.2" }</code></pre>
<details> <summary>kotlin-dsl</summary>
<pre><code class="lang-kotlin">dependencies { implementation("io.github.sinuscosinustan:hetznercloud-api:5.0.2") }</code></pre> </details>
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)
<pre><code class="lang-bash">mvn test</code></pre>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.
<pre><code class="lang-bash">HCLOUDTOKEN="${apikey}" mvn test -Pintegration-tests</code></pre>
Code Quality
Checkstyle
Checkstyle runs automatically during compilation:
<pre><code class="lang-bash">mvn compile</code></pre>
Code Coverage (JaCoCo)
Generate code coverage reports:
<pre><code class="lang-bash">mvn test</code></pre>
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:
- jackson-databind under Apache2.0 License
- Lombok under MIT License