project.hasFacet(MavenFacet.class) should be preferred instead