class MavenScopeDependenciesValidator extends AbstractMavenPluginDependenciesValidator {

    @Inject
    MavenScopeDependenciesValidator(PluginValidationManager pluginValidationManager) {
        super(pluginValidationManager);
    }

    @Override
    protected void doValidate(
            RepositorySystemSession session,
            Artifact pluginArtifact,
            ArtifactDescriptorResult artifactDescriptorResult) {<FILL_FUNCTION_BODY>}
}

        Set<String> mavenArtifacts = artifactDescriptorResult.getDependencies().stream()
                .filter(d -> !DependencyScope.PROVIDED.is(d.getScope()) && !DependencyScope.TEST.is(d.getScope()))
                .map(org.eclipse.aether.graph.Dependency::getArtifact)
                .filter(a -> "org.apache.maven".equals(a.getGroupId()))
                .filter(a -> !DefaultPluginValidationManager.EXPECTED_PROVIDED_SCOPE_EXCLUSIONS_GA.contains(
                        a.getGroupId() + ":" + a.getArtifactId()))
                .filter(a -> a.getVersion().startsWith("3."))
                .map(a -> a.getGroupId() + ":" + a.getArtifactId() + ":" + a.getVersion())
                .collect(Collectors.toSet());

        if (!mavenArtifacts.isEmpty()) {
            pluginValidationManager.reportPluginValidationIssue(
                    PluginValidationManager.IssueLocality.EXTERNAL,
                    session,
                    pluginArtifact,
                    "Plugin should declare Maven artifacts in `provided` scope. If the plugin already declares them in `provided` scope, update the maven-plugin-plugin to latest version. Artifacts found with wrong scope: "
                            + mavenArtifacts);
        }
    
<methods>public void validate(RepositorySystemSession, Artifact, ArtifactDescriptorResult) <variables>protected final non-sealed org.apache.maven.plugin.PluginValidationManager pluginValidationManager