johnrengelman/shadow

Can't depend on shadowjar as project dependency?

rehevkor5 opened this issue · 1 comments

Shadow Version

7.1.2

Gradle Version

7.6.2

Expected Behavior

https://imperceptiblethoughts.com/shadow/multi-project/ says to depend on a shadowed JAR from a local project, you need to do something like this (otherwise it just silently doesn't do what you expect!):

implementation project(path: ':shaded-other-project', configuration: 'shadow')

Expected result: the classes inside the shadow JAR (as well as its transitive dependencies that were excluded from shading) are on the implementation classpath.

Actual Behavior

The build fails with this error:

A problem occurred evaluating root project 'my-project'.
> Could not find method project() for arguments [{configuration=shadow}, :shaded-other-project] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Gradle Build Script(s)

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

Ah, I missed adding path: to the first argument.