public static String[] getModifiedFiles(
     MavenSession mavenSession,
     MojoExecution mojoExecution,
     IMaven maven,
     BuildContext buildContext,
     String sourceParam,
     String includesParam,
     String excludesParam)
     throws Exception {
   return getModifiedFiles(
       buildContext,
       maven.getMojoParameterValue(mavenSession, mojoExecution, sourceParam, File.class),
       maven.getMojoParameterValue(mavenSession, mojoExecution, includesParam, String[].class),
       maven.getMojoParameterValue(mavenSession, mojoExecution, excludesParam, String[].class));
 }
  /**
   * {@inheritDoc}
   *
   * @see org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant#build(int,
   *     org.eclipse.core.runtime.IProgressMonitor)
   */
  @Override
  public Set<IProject> build(int kind, IProgressMonitor monitor) throws Exception {
    final IMaven maven = MavenPlugin.getMaven();
    final BuildContext buildContext = getBuildContext();
    final MavenProject project = getMavenProjectFacade().getMavenProject();
    final MojoExecution mojoExecution = getMojoExecution();

    // execute mojo
    final Set<IProject> result = super.build(kind, monitor);

    // tell m2e builder to refresh generated files
    File generated =
        maven.getMojoParameterValue(project, mojoExecution, "outputDirectory", File.class, monitor);
    if (generated != null) {
      buildContext.refresh(generated);
    }

    return result;
  }