Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to query the project's dependencies via Gradle #2

Open
sschuberth opened this issue Apr 10, 2018 · 2 comments
Open

Unable to query the project's dependencies via Gradle #2

sschuberth opened this issue Apr 10, 2018 · 2 comments

Comments

@sschuberth
Copy link

This is an issue with the project's build system (and Scala plugin), not with the project itself. For checking a Gradle project's dependencies I usually execute the dependencies task, but that fails for this project:

$ ./gradlew scanns:dependencies
Parallel execution with configuration on demand is an incubating feature.
Build cache is an incubating feature.
Using local directory build cache for build ':buildSrc' (location = C:\Users\seschube\.gradle\caches\build-cache-1).
:buildSrc:compileJava NO-SOURCE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava NO-SOURCE
:buildSrc:compileTestGroovy NO-SOURCE
:buildSrc:processTestResources NO-SOURCE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test NO-SOURCE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE

FAILURE: Build failed with an exception.

* What went wrong:
Project 'scanns' is ambiguous in root project 'scanns'. Candidates are: 'scanns_2.10', 'scanns_2.11'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 2s
@namitk
Copy link
Contributor

namitk commented Apr 10, 2018

Thanks for pointing this out. This is happening because of the cross-building support added to the module to allow users to build it against their desired scala versions.

In case you haven't unblocked yourself yet, ./gradlew :scanns_2.10:dependencies or ./gradlew :scanns_2.11:dependencies will work. They will both yield the same result except all their respective dependencies will be built against the particular scala version. IMO, this is the correct behavior: the dependencies can't be pin-pointed unless you specify the scala version you are building against but I'll see if I can assign a default behavior so that ./gradlew :scanns:dependencies also succeeds, assuming a particular version of scala.

@sschuberth
Copy link
Author

Thanks for the explanation. BTW, is there a separate repository where the Scala Cross Build Gradle plugin is maintained? So far I only saw its source code being committed as buildSrc to multiple projects, but if you did the fix to make ./gradlew :scanns:dependencies work, that fix would probably happen in the plugin, and it would make sense that other projects would get this fix, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants