code: private Set<Artifact> determineRelevantPluginDependencies() throws MojoExecutionException {
          Set<Artifact> relevantDependencies;
          if (this.includePluginDependencies) {
              if (this.executableDependency == null) {
                  getLog().debug("All Plugin Dependencies will be included.");
                  relevantDependencies = new HashSet<Artifact>(this.pluginDependencies);
              } else {
                  getLog().debug("Selected plugin Dependencies will be included.");
                  Artifact executableArtifact = this.findExecutableArtifact();
                  Artifact executablePomArtifact = this.getExecutablePomArtifact(executableArtifact);
                  relevantDependencies = this.resolveExecutableDependencies(executablePomArtifact, false);
              }
          } else {
              getLog().debug("Only Direct Plugin Dependencies will be included.");
              PluginDescriptor descriptor = (PluginDescriptor) getPluginContext().get("pluginDescriptor");
              try {
                  relevantDependencies = artifactResolver
                      .resolveTransitively(MavenMetadataSource
                              .createArtifacts(this.artifactFactory,
                                  descriptor.getPlugin().getDependencies(),
                                  null, null, null),
                          this.project.getArtifact(),
                          Collections.emptyMap(),
                          this.localRepository,
                          this.remoteRepositories,
                          metadataSource,
                          new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME),
                          Collections.emptyList())
                      .getArtifacts();
              } catch (Exception ex) {
                  throw new MojoExecutionException("Encountered problems resolving dependencies of the plugin "
                      + "in preparation for its execution.", ex);
              }
          }
          return relevantDependencies;
      }
docs: Determine all plugin dependencies relevant to the executable. Takes
  includePlugins, and the executableDependency into consideration.
  
  @return a set of Artifact objects. (Empty set is returned if there are no
  relevant plugin dependencies.)
  @throws MojoExecutionException