'Gradle: include "subdependencies" as well?

I created a multi module project with gradle:

rootProject.name = 'test_gradle'

include 'modul_A'
include 'modul_B'

project(':modul_A').name = 'Opel'

Project Opel uses apache log4j2 as dependency.

implementation 'org.apache.logging.log4j:log4j-core:2.17.2'

In module_B Opel is used as dependency:

implementation project(':Opel')

In module_B the IDE finds any classes created in Opel, but can't access any of these which uses log4j components. It seems the implementation keyword just included classes of module Opel and not its sub-dependencies(here: log4j2). How can I change that? And no, I don't want to include log4j2 by hand in module_B



Solution 1:[1]

https://docs.gradle.org/current/userguide/java_library_plugin.html

Solves the issue.

It's necessary to use the plugin before "api" is available

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Simon2215