-
Notifications
You must be signed in to change notification settings - Fork 6
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
Issue resolving merged jars with test suites #101
Comments
This looks to me like a general Gradle configuration timing problem. In your setup, you directly access the configuration time state of another (sub)project. This is generally discouraged and future Gradle versions might even forbid it.
When you access the "implementation" Configuration of the ":app" project, it might not yet be filled with dependencies if that part of the ":app" project is configured after the ":ext" project. I know too little about your project, to give you the exact advice for how to do this better. Maybe the dependencies in ":app" can be defined in "api" scope? Then they would be automatically visible at compile time by this line alone: |
Thanks for the explanation, I changed the
and removed all instances of the configuration access. To make this case simpler, I also removed the test suite for reproducing this issue. The only thing I now have in the
and I still get the following error:
If I change the ext project to
it works however. |
Ah yes. This a specific tidbit with the "jar merge" functionality. To perform the merge in isolation, there is a specific dependency scope – The plugin does:
Which means, it takes versions from the runtime classpath – which works in most cases. But if you only use I can check if I can add some more information to the docs and/or improve the error message. What you can do, if you want to keep the
Or see set the
|
Thanks for the help, it works now as expected! So yeah I think adding a little bit more detail to the error messages or documentation would be helpful in this case also for other people as I'm probably not the only one who uses compileOnly for some merged module dependencies. |
Follow up: #107 |
I have configured the following test suite:
that I use in several gradle modules to have the
app
project and its dependencies available when running the test. This works fine for regular dependencies.However, I also have this extra module info defined:
In the
app
project, I have all dependencies added:When I try to run the
localTest
suite in another module, lets call it theext
gradle module, which uses the app module for tests in its test suite, I get the following error:However, if I add only one dependency to the
ext
gradle module, it fixes the problem:This behavior is a little bit unexpected. I either expected it to require me to define all dependencies again or work without having to do that. I'm not sure whether that is a bug though.
The text was updated successfully, but these errors were encountered: