Open agentgt opened 5 years ago
Per the Javadoc on JavaCore:
/**
* Returns the Java project corresponding to the given project.
* <p>
* Creating a Java Project has the side effect of creating and opening all of the
* project's parents if they are not yet open.
* <p>
* Note that no check is done at this time on the existence or the java nature of this project.
*
* @param project the given project
* @return the Java project corresponding to the given project, null if the given project is null
*/
public static IJavaProject create(IProject project) {
if (project == null) {
return null;
}
JavaModel javaModel = JavaModelManager.getJavaModelManager().getJavaModel();
return javaModel.getJavaProject(project);
}
Notice:
Note that no check is done at this time on the existence or the java nature of this project.
Doma Tools causes Eclipse to throw an exception for multimodule maven projects.
The issue is that multimodule maven projects often have a parent project that is NOT a Java project.
e.g. directory structure:
For m2e to work both projects need to be imported.
The resource listener incorrectly assumes the Parent POM project (parent project w/ modules) into a Java Project (Java Nature).
I guess
JavaCore.create
will happily turn any project into a Java project even if it isn't.Below is the exception: