@SuppressWarnings("restriction")
  @Override
  public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor)
      throws CoreException {

    markerManager.deleteMarkers(request.getProject(), MISSING_ENDORSED_DIRS_MARKER);

    IMavenProjectFacade mavenProjectFacade = request.getMavenProjectFacade();
    File[] endorsedDirs = getEndorsedDirs(mavenProjectFacade, monitor);
    if (endorsedDirs == null || endorsedDirs.length == 0) {
      return;
    }

    Set<File> missingEndorsedDir = checkMissingDirs(endorsedDirs);
    if (!missingEndorsedDir.isEmpty()) {
      MojoExecutionKey key =
          new MojoExecutionKey(
              "org.apache.maven.plugins", "maven-compiler-plugin", null, null, null, null);
      SourceLocation sourceLocation =
          SourceLocationHelper.findLocation(mavenProjectFacade.getMavenProject(), key);
      for (File dir : missingEndorsedDir) {
        addMissingDirWarning(request.getProject(), sourceLocation, dir);
      }
    }
  }
  @Override
  public void configure(final ProjectConfigurationRequest request, final IProgressMonitor monitor)
      throws CoreException {

    final MavenProject mavenProject = request.getMavenProject();
    if (mavenProject == null) {
      return;
    }

    final MavenPluginWrapper pluginWrapper =
        this.getMavenPlugin(monitor, request.getMavenProjectFacade());
    final IProject project = request.getProject();

    if (!pluginWrapper.isPluginConfigured()) {
      return;
    }

    this.handleProjectConfigurationChange(
        request.getMavenSession(),
        request.getMavenProjectFacade(),
        project,
        monitor,
        pluginWrapper);
  }
  public void configureRawClasspath(
      ProjectConfigurationRequest request, IClasspathDescriptor classpath, IProgressMonitor monitor)
      throws CoreException {

    IJavaProject javaProject = JavaCore.create(request.getProject());
    if (javaProject == null) {
      return;
    }

    File[] endorsedDirs = getEndorsedDirs(request.getMavenProjectFacade(), monitor);

    if (endorsedDirs == null || endorsedDirs.length == 0) {
      ClasspathHelpers.removeEndorsedLibClasspathContainer(classpath);
      return;
    }

    getEndorsedLibrariesManager()
        .configureEndorsedLibs(javaProject, classpath, endorsedDirs, monitor);
  }