public void execute()

in core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/InjectMojo.java [73:114]


    public void execute() throws MojoExecutionException {
        Set artifactKeys = new LinkedHashSet();

        if (artifacts != null) {
            artifactKeys.addAll(Arrays.asList(artifacts));
        }

        Set dependencyArtifacts = project.getDependencyArtifacts();

        if (dependencyArtifacts != null) {
            dependencyArtifacts = new LinkedHashSet(dependencyArtifacts);
        } else {
            dependencyArtifacts = new LinkedHashSet();
        }

        for (Object pluginArtifact : pluginArtifacts) {
            Artifact artifact = (Artifact) pluginArtifact;

            String artifactKey = artifact.getGroupId() + ':' + artifact.getArtifactId();

            if (artifactKeys.remove(artifactKey)) {
                artifact = factory.createArtifact(
                        artifact.getGroupId(),
                        artifact.getArtifactId(),
                        artifact.getVersion(),
                        Artifact.SCOPE_COMPILE,
                        artifact.getType());

                getLog().info("[MAVEN-CORE-IT-LOG] Injecting dependency artifact " + artifact);

                dependencyArtifacts.add(artifact);
            }
        }

        project.setDependencyArtifacts(dependencyArtifacts);

        getLog().info("[MAVEN-CORE-IT-LOG] Set dependency artifacts to " + dependencyArtifacts);

        if (!artifactKeys.isEmpty()) {
            getLog().warn("[MAVEN-CORE-IT-LOG] These artifacts were not found " + artifactKeys);
        }
    }