I have a multi-project scenario where one subproject generates multiple jars. I want to set up dependencies so that a second project is able to depend on just one jar in the multipi-jar subproject. It looks like Gradle handles this nicely, but I can’t get the syntax to work.
A problem occurred evaluating root project 'artifactTest'.
> Could not resolve all dependencies for configuration ':compile'.
> Module version group:, module:artifactTest, version:unspecified, configuration:compile declares a dependency on configuration 'config1' which is not declared in the module descriptor for group:artifactTest, module:subproject, version:unspecified
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/mbrand/tmp/artifactTest/build.gradle' line: 7
* What went wrong:
A problem occurred evaluating root project 'artifactTest'.
> Could not resolve all dependencies for configuration ':compile'.
> Module version group:, module:artifactTest, version:unspecified, configuration:compile declares a dependency on configuration 'myConfig1' which is not declared in the module descriptor for group:artifactTest, module:sp1, version:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.166 secs
If I haven’t addressed this correctly could you provide an example of what I can do to get this working?
I found it. The subproject did not have the line “apply plugin: ‘java’”. The error messages were not intuitive and were different depending on whether I used the configuration or not.
Thanks for your help, Luke. I was going to upload a zip in case you needed it, but it looks like more work than it’s worth. Let me know if you’d like to see it after all.