Hello
Example 2. Adding of test task to each project which has certain property set in this link Build Lifecycle
the if statement need to be modified to the following code to make it work
if (project.hasProperty("hasTests") && project.hasTests)
also it would be better to notifiy the reader that he/she would need to create subproject called project-a
and also the property in the build file in the project a should be changed to
ext.hasTests = true
cause there no hasTests property in the Project so we need to create one in the ext part
or maybe i miss something
so hope that help and have a nice day