private static String guessPackaging ( ProjectModel projectModel ) { String projectType = projectModel . getProjectType ( ) ; if ( projectType != null ) return projectType ; LOG . warning ( "WINDUP-983 getProjectType() returned null for: " + projectModel . getRootFileModel ( ) . getPrettyPath ( ) ) ; String suffix = StringUtils . substringAfterLast ( projectModel . getRootFileModel ( ) . getFileName ( ) , "." ) ; if ( "jar war ear sar har " . contains ( suffix + " " ) ) { projectModel . setProjectType ( suffix ) ; // FIXME: Remove when WINDUP-983 is fixed. return suffix ; } // Should we try something more? Used APIs? What if it's a source? return "unknown" ; }
Tries to guess the packaging of the archive - whether it s an EAR WAR JAR . Maybe not needed as we can rely on the suffix?