public static boolean moduleExists ( File pom , String relativePath , String profileId , Log logger ) throws IOException , XmlPullParserException { if ( relativePath == null ) return false ; Model model = getModelFromPOM ( pom , logger ) ; relativePath = relativePath . replace ( "\\" , "/" ) ; if ( profileId != null && ! profileId . isEmpty ( ) ) { Profile p = getProfile ( model , profileId ) ; if ( p != null ) { return p . getModules ( ) . indexOf ( relativePath ) >= 0 ; } } else { return model . getModules ( ) . indexOf ( relativePath ) >= 0 ; } return false ; }
Check whether a module exists in a POM .