core/src/main/java/io/fabric8/maven/core/util/MavenUtil.java
public static Plugin getPlugin(MavenProject project, String groupId, String artifactId) {
        if (artifactId == null) {
            throw new IllegalArgumentException("artifactId cannot be null");
        }

        List<Plugin> plugins = project.getBuildPlugins();
        if (plugins != null) {
            for (Plugin plugin : plugins) {
                boolean matchesArtifactId = artifactId.equals(plugin.getArtifactId());
                boolean matchesGroupId = groupId == null || groupId.equals(plugin.getGroupId());

                if (matchesGroupId && matchesArtifactId) {
                    return plugin;
                }
            }
        }
        return null;
    }
public static Plugin getPlugin(MavenProject project, String groupId, String artifactId) {
        if (artifactId == null) {
            throw new IllegalArgumentException("artifactId cannot be null");
        }

        List<Plugin> plugins = project.getBuildPlugins();
        if (plugins != null) {
            for (Plugin plugin : plugins) {
                boolean matchesArtifactId = artifactId.equals(plugin.getArtifactId());
                boolean matchesGroupId = groupId == null || groupId.equals(plugin.getGroupId());

                if (matchesGroupId && matchesArtifactId) {
                    return plugin;
                }
            }
        }
        return null;
    }
public static Plugin getPlugin ( MavenProject project , String groupId , String artifactId ) { if ( artifactId == null ) { throw new IllegalArgumentException ( "artifactId cannot be null" ) ; } List < Plugin > plugins = project . getBuildPlugins ( ) ; if ( plugins != null ) { for ( Plugin plugin : plugins ) { boolean matchesArtifactId = artifactId . equals ( plugin . getArtifactId ( ) ) ; boolean matchesGroupId = groupId == null || groupId . equals ( plugin . getGroupId ( ) ) ; if ( matchesGroupId && matchesArtifactId ) { return plugin ; } } } return null ; }
Returns the plugin with the given groupId (if present) and artifactId.
Returns the plugin with the given groupId ( if present ) and artifactId .