> For the complete documentation index, see [llms.txt](https://result.leakyabstractions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://result.leakyabstractions.com/docs/start/adding-dependency.md).

# Adding Result to Your Build

How to add Result as a dependency to your build

This library adheres to [Pragmatic Versioning](https://pragver.github.io/) to communicate the backwards compatibility of each version.

The latest releases are available in [![Maven Central repository](https://137539276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfavUYGNGvzkCicVu3-%2Fuploads%2FtxlH7FxQGh58wxNhEh3T%2Flogo-maven-central.svg?alt=media\&token=fd080dda-c1a1-4679-b6ff-a7d2184e5b12)](https://central.sonatype.com/artifact/com.leakyabstractions/result/)

Result supports both [**Maven**](https://maven.apache.org/) and [**Gradle**](https://gradle.org/) for seamless integration into your Java build workflow.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td><a href="https://maven.apache.org/"><strong>Apache Maven</strong></a> is a convention-based Java build tool that uses XML configuration to manage dependencies, compile code, and package applications in a standardized lifecycle.</td><td><a href="#maven">#maven</a></td><td data-object-fit="contain"><a href="https://137539276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfavUYGNGvzkCicVu3-%2Fuploads%2FMi2S8tFmj71pETLI3y1q%2Flogo-maven.svg?alt=media&amp;token=06775086-fc8c-473b-82ce-6ce94c4d69ad">logo-maven.svg</a></td><td><a href="https://137539276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfavUYGNGvzkCicVu3-%2Fuploads%2Fxif2fN7yx1BMJqu9vaS8%2Flogo-maven.dark.svg?alt=media&amp;token=a93c4b41-233e-452b-9856-14e3915f9807">logo-maven.dark.svg</a></td></tr><tr><td><a href="https://gradle.org/"><strong>Gradle</strong></a> is a flexible and high-performance build tool that uses a Groovy or Kotlin DSL to define builds, offering advanced customization and fast incremental builds.</td><td><a href="#gradle">#gradle</a></td><td data-object-fit="contain"><a href="https://137539276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfavUYGNGvzkCicVu3-%2Fuploads%2FLB7k99sphYsbAP8dv3jU%2Flogo-gradle.svg?alt=media&amp;token=c0af3fa4-e390-4f58-9527-213f083ea564">logo-gradle.svg</a></td><td><a href="https://137539276-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfavUYGNGvzkCicVu3-%2Fuploads%2FYGExjPQG6IqBloETpgOD%2Flogo-gradle.dark.svg?alt=media&amp;token=6a5f1e6f-3e8f-4d03-affc-6b980140cc3c">logo-gradle.dark.svg</a></td></tr></tbody></table>

## Artifact Coordinates

Add this Maven dependency to your build:

| Group ID                | Artifact ID | Latest Version                                                                                |
| ----------------------- | ----------- | --------------------------------------------------------------------------------------------- |
| `com.leakyabstractions` | `result`    | ![](https://img.shields.io/endpoint?url=https://dev.leakyabstractions.com/result/latest.json) |

{% hint style="success" %}
[Maven Central](https://central.sonatype.com/artifact/com.leakyabstractions/result/) provides snippets for different build tools to declare this dependency.
{% endhint %}

## Maven

Add Result as a Maven dependency to your project.

```xml
<dependencies>
    <dependency>
        <groupId>com.leakyabstractions</groupId>
        <artifactId>result</artifactId>
        <version>1.0.0.0</version>
    </dependency>
</dependencies>
```

## Gradle

Add Result as a Gradle dependency to your project.

```groovy
dependencies {
    implementation("com.leakyabstractions:result:1.0.0.0")
}
```

{% hint style="info" %}
This is the most common configuration for projects using Result internally. If we were building a library that exposed Result in its public API, [we should use `api` instead of `implementation`](https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation).
{% endhint %}

## Conclusion

We learned how to add the library to your project using either Maven or Gradle. By including the correct dependencies, you're now ready to start leveraging the power of Results in your applications.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://result.leakyabstractions.com/docs/start/adding-dependency.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
