This method could be changed to 
    getProject().getFacet(MavenPackagingFacet.class).getPackagingType()