public static void removeDependency ( File pom , Dependency dependency , Log logger ) throws IOException , XmlPullParserException { Model model = getModelFromPOM ( pom , logger ) ; for ( Iterator < Dependency > it = model . getDependencies ( ) . iterator ( ) ; it . hasNext ( ) ; ) { if ( dependenciesEqual ( it . next ( ) , dependency ) ) { it . remove ( ) ; } } writeModelToPOM ( model , pom , logger ) ; }
Remove the Maven dependency from a POM file .