public static Plugin findPlugin ( List < Plugin > plugins , String artifactId ) { if ( plugins != null ) { for ( Plugin plugin : plugins ) { String groupId = plugin . getGroupId ( ) ; if ( Strings . isNullOrBlank ( groupId ) || Objects . equal ( groupId , mavenPluginsGroupId ) ) { if ( Objects . equal ( artifactId , plugin . getArtifactId ( ) ) ) { return plugin ; } } } } return null ; }
Returns the maven plugin for the given artifact id or returns null if it cannot be found