Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions toolchain/docs/dependencies/nonmclibs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ dependencies {
additionalRuntimeClasspath 'com.example:example:1.0'
}
```
:::warning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a newline before this.

However, using a library that has transitive dependencies will require you to manually exclude and `additionalRuntimeClasspath` / `implementation` the dependency yourself. This is only needed if that specific module is required at runtime; compilation will proceed fine.
Comment thread
c-Caelum marked this conversation as resolved.
Outdated

```gradle
dependencies {
// This is required to add the library at compile time
implementation 'com.example:example:1.0'
// This adds the library to all the runs
additionalRuntimeClasspath 'com.example:example:1.0' {
// exclude the transitive dependency you want to add to the classpath
Comment thread
c-Caelum marked this conversation as resolved.
Outdated
exclude 'com.example:dependency'
}
// add the module back to the classpath
additionalRuntimeClasspath 'com.example:my_module:1.0'
Comment thread
c-Caelum marked this conversation as resolved.
Outdated
}
```
:::

</TabItem>
<TabItem value="ng" label="NeoGradle">
Expand Down