Search in sources :

Example 1 with MavenClasspathContainer

use of org.eclipse.che.plugin.maven.server.core.MavenClasspathContainer in project che by eclipse.

the class ClasspathManager method updateClasspath.

public void updateClasspath(MavenProject mavenProject) {
    IJavaProject javaProject = JavaCore.create(mavenProject.getProject());
    if (javaProject != null) {
        IClasspathEntry[] entries = getClasspath(mavenProject);
        MavenClasspathContainer container = new MavenClasspathContainer(entries);
        try {
            JavaCore.setClasspathContainer(new Path(MavenClasspathContainer.CONTAINER_ID), new IJavaProject[] { javaProject }, new IClasspathContainer[] { container }, new NullProgressMonitor());
        } catch (JavaModelException e) {
            LOG.error(e.getMessage(), e);
        }
    }
}
Also used : Path(org.eclipse.core.runtime.Path) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) JavaModelException(org.eclipse.jdt.core.JavaModelException) IJavaProject(org.eclipse.jdt.core.IJavaProject) IClasspathEntry(org.eclipse.jdt.core.IClasspathEntry) MavenClasspathContainer(org.eclipse.che.plugin.maven.server.core.MavenClasspathContainer)

Aggregations

MavenClasspathContainer (org.eclipse.che.plugin.maven.server.core.MavenClasspathContainer)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Path (org.eclipse.core.runtime.Path)1 IClasspathEntry (org.eclipse.jdt.core.IClasspathEntry)1 IJavaProject (org.eclipse.jdt.core.IJavaProject)1 JavaModelException (org.eclipse.jdt.core.JavaModelException)1