Gradle Build Error

I have two Gradle projects, A and B B is a simple Java application and is consumed by A as a compiled project dependency. A is a web application.

Both A and B use the java plugin, A also uses the war plugin.

When building A I get the following error:

 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':war'. > Configuration with name 'default' not found. 

When building separately B I get no errors. When creating from the root, I also get no errors. The problem only occurs when creating A

I also tried copying B.jar to lib A folder and installing the dependency:

 compile files("lib/B.jar") 

The string in this case works fine.

What configurations must be enabled to avoid errors?

+4
source share
1 answer

It is possible when one subproject does not see the other, if the settings.gradle file is not in the parent directory for both subprojects, and the subprojects in it are included via includeFlat. In this case, you can call any task from your parent projects, and all subprojects will know about each other, but they will not be able to build a separate subproject.

In any case, you need to show the project structure and build / configuration files to find out the problem.

+1
source

All Articles