use of org.eclipse.m2e.core.ui.internal.actions.EnableNatureAction in project sling by apache.
the class MavenProjectAdapter method convertToMavenProject.
/**
* Converts the wrapped project to a Maven project
*
* <p>It waits for for the conversion to succeed, and fails with an unchecked exception
* if the conversion does not succeed in the allocated time.</p>
*
* @throws CoreException
* @throws InterruptedException
*/
public void convertToMavenProject() throws CoreException, InterruptedException {
EnableNatureAction action = new EnableNatureAction();
action.selectionChanged(null, new StructuredSelection(getProject()));
action.run(null);
new Poller().pollUntil(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return getProject().hasNature(IMavenConstants.NATURE_ID);
}
}, CoreMatchers.equalTo(true));
}
Aggregations