projects being added to a farm must be present in gradle project tree, otherwise you’ll get "unknown project" error. You add projects to the project tree via "settings.gradle". See more information in Chapter 56. Multi-project Builds of gradle documentation.

File-based web-app references

Farms support adding a web-app directly from WAR-file, without gradle project: