code: private static Set<String> getIncludedProjectIdentifiers(final Project project) {
          return getCachedReference(project, "thorntail_included_project_identifiers", () -> {
              Set<String> identifiers = new HashSet<>();
  
              // Check for included builds as well.
              project.getGradle().getIncludedBuilds().forEach(build -> {
                  // Determine if the given reference has the following method definition,
                  // org.gradle.internal.build.IncludedBuildState#getAvailableModules()
                  try {
                      Method method = build.getClass().getMethod("getAvailableModules");
                      Class<?> retType = method.getReturnType();
                      if (Set.class.isAssignableFrom(retType)) {
                          // We have identified the right method. Get the values out of it.
                          Set availableModules = (Set) method.invoke(build);
                          for (Object entry : availableModules) {
                              Field field = entry.getClass().getField("left");
                              Object value = field.get(entry);
                              if (value instanceof ModuleVersionIdentifier) {
                                  ModuleVersionIdentifier mv = (ModuleVersionIdentifier) value;
                                  identifiers.add(String.format("%s:%s:%s", mv.getGroup(), mv.getName(), mv.getVersion()));
                              } else {
                                  project.getLogger().debug("Unable to determine field type: {}", field);
                              }
                          }
                      } else {
                          project.getLogger().debug("Unable to determine method return type: {}", retType);
                      }
                  } catch (ReflectiveOperationException e) {
                      project.getLogger().debug("Unable to determine the included projects.", e);
                  }
              });
              return identifiers;
          });
      }
docs: Attempt to load the project identifiers (group:artifact) for projects that have been included. This method isn't
  guaranteed to work all the time since there is no good API that we can use and need to rely on reflection for now.
  
  @param project the project reference.
  @return a collection of "included" project identifiers (a.k.a., composite projects).