public static Plugin getPlugin(MavenProject project, String groupId, String artifactId) {
    """
	Returns the plugin with the given groupId (if present) and 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 .