I made a tag issue22 to reproduce this problem. You can checkout the issue22 tag and see on your machine.
I ran:
:~/github/selenium-webdriver-java ((issue22) +)
$ ./gradlew -q :selenium-webdriver-testng:test --tests="*ch05.cdp.FullPageScreenshot*"
I expected that a file fullpage-screenshot-chrome.png will be written into the subproject's root directory. So I exected find a file
./selenium-webdriver-testng/fullpage-screenshot-chrome.png
However, in fact, I found the fullpage-screenshot-chrome.png file is written into the parent project's root directory, as shown in the following tree.
$ tree -L 1
.
├── LICENSE
├── README.md
├── alternatives
├── build
├── docs
├── fullpage-screenshot-chrome.png <==== why this file is written here ?!
├── fullpage-screenshot-firefox.png <==== why this file is written here ?!
├── gradle
├── gradlew
├── gradlew.bat
├── pom.xml
├── selenium-ide
├── selenium-webdriver-junit4
├── selenium-webdriver-junit5
├── selenium-webdriver-junit5-seljup
├── selenium-webdriver-testng
└── settings.gradle
10 directories, 8 files
I don't think I can solve this problem. It's too weired. I have no clue.