JBIDE-18847 : Extract discovery code out of project examples

Signed-off-by: Fred Bricon <fbricon@gmail.com>