> For the complete documentation index, see [llms.txt](https://axelrindle.gitbook.io/pocketknife/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axelrindle.gitbook.io/pocketknife/package-reloaction.md).

# Package reloaction

To avoid classpath conflicts with other plugins using the same dependencies, dependencies should be relocated to a unique package. More information [can be found here](https://imperceptiblethoughts.com/shadow/configuration/relocation/).

The following Gradle configuration relocates all dependencies using the `shadow` plugin, that will be included in the jar file, to a new location:

```groovy
plugins {
    id 'com.github.johnrengelman.shadow' version '6.1.0'
}

shadowJar {
    archiveClassifier.set('') // remove the 'all' suffix
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
task relocateShadowJar(type: ConfigureShadowRelocation) {
    target = tasks.shadowJar
    prefix = "mypluginshadow" // Default value is "shadow"
}

tasks.shadowJar.dependsOn tasks.relocateShadowJar
```

Afterwards a jar file can be built by running the Gradle task `shadowJar`.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://axelrindle.gitbook.io/pocketknife/package-reloaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
