'How to add tests from a different Gradle module in the TestNG suite.xml?

I am working on the architecture of my TestNG project and I want to put all my Suite XML files in a core Gradle module and keep the tests in separate feature-based Gradle modules.

The problem with this approach is that the files under test directory in Gradle are not accessible to other modules. So the Suite XML files in the core module cannot refer to the test classes present in the feature modules.

Is there a solution available for this problem?



Sources

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

Source: Stack Overflow

Solution Source