Gradle task to only download dependencies #35

Closed
opened 2025-12-30 01:19:48 +01:00 by adam · 2 comments
Owner

Originally created by @rafaelrc7 on GitHub (Feb 6, 2024).

Hello, I'm trying to package pkl to NixOS. However, to this end, I would ideally need a gradle task that only downloads the dependencies, without trying to build the program. Does the project has something like this?

Thanks.

Originally created by @rafaelrc7 on GitHub (Feb 6, 2024). Hello, I'm trying to package pkl to NixOS. However, to this end, I would ideally need a gradle task that only downloads the dependencies, without trying to build the program. Does the project has something like this? Thanks.
adam closed this issue 2025-12-30 01:19:48 +01:00
Author
Owner

@bioball commented on GitHub (Feb 6, 2024):

Looks like you should be able to run dependencies, which will download dependencies as a side-effect: https://stackoverflow.com/a/50219857

So, this would work:

./gradlew \
    bench:dependencies \
    docs:dependencies \
    pkl-cli:dependencies \
    pkl-codegen-java:dependencies \
    pkl-codegen-kotlin:dependencies \
    pkl-commons:dependencies \
    pkl-commons-cli:dependencies \
    pkl-commons-test:dependencies \
    pkl-config-java:dependencies \
    pkl-config-kotlin:dependencies \
    pkl-core:dependencies \
    pkl-doc:dependencies \
    pkl-executor:dependencies \
    pkl-gradle:dependencies \
    pkl-server:dependencies \
    pkl-tools:dependencies \
    stdlib:dependencies

Sidenote: seems like every sub-project needs to be included here because naked ./gradlew dependencies only shows dependencies on the root project: https://github.com/gradle/gradle/issues/17829

@bioball commented on GitHub (Feb 6, 2024): Looks like you should be able to run `dependencies`, which will download dependencies as a side-effect: https://stackoverflow.com/a/50219857 So, this would work: ``` ./gradlew \ bench:dependencies \ docs:dependencies \ pkl-cli:dependencies \ pkl-codegen-java:dependencies \ pkl-codegen-kotlin:dependencies \ pkl-commons:dependencies \ pkl-commons-cli:dependencies \ pkl-commons-test:dependencies \ pkl-config-java:dependencies \ pkl-config-kotlin:dependencies \ pkl-core:dependencies \ pkl-doc:dependencies \ pkl-executor:dependencies \ pkl-gradle:dependencies \ pkl-server:dependencies \ pkl-tools:dependencies \ stdlib:dependencies ``` Sidenote: seems like every sub-project needs to be included here because naked `./gradlew dependencies` only shows dependencies on the root project: https://github.com/gradle/gradle/issues/17829
Author
Owner

@rafaelrc7 commented on GitHub (Feb 6, 2024):

./gradlew dependencies only shows dependencies on the root project

Aha, that was what I was stuck with, thanks a lot!

This solved most of the problems, but curiously, there seems to be at least one dependency, com.google.googlejavaformat:google-java-format:1.15.0, that did not get pulled by this. I had to add the bench:spotlessJava task to the command to pull this one too.

I'm still going through errors as they appear. But I believe this part is solved.

Thanks for the quick response!

@rafaelrc7 commented on GitHub (Feb 6, 2024): > ./gradlew dependencies only shows dependencies on the root project Aha, that was what I was stuck with, thanks a lot! This solved most of the problems, but curiously, there seems to be at least one dependency, `com.google.googlejavaformat:google-java-format:1.15.0`, that did not get pulled by this. I had to add the `bench:spotlessJava` task to the command to pull this one too. I'm still going through errors as they appear. But I believe this part is solved. Thanks for the quick response!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#35