private void processProject()

in src/main/java/org/apache/maven/plugins/install/InstallMojo.java [196:229]


    private void processProject(MavenProject project, InstallRequest request) throws MojoExecutionException {
        if (isFile(project.getFile())) {
            request.addArtifact(RepositoryUtils.toArtifact(new ProjectArtifact(project)));
        } else {
            throw new MojoExecutionException("The project POM could not be attached");
        }

        if (!"pom".equals(project.getPackaging())) {
            org.apache.maven.artifact.Artifact mavenMainArtifact = project.getArtifact();
            if (isFile(mavenMainArtifact.getFile())) {
                request.addArtifact(RepositoryUtils.toArtifact(mavenMainArtifact));
            } else if (!project.getAttachedArtifacts().isEmpty()) {
                if (allowIncompleteProjects) {
                    getLog().warn("");
                    getLog().warn("The packaging plugin for this project did not assign");
                    getLog().warn("a main file to the project but it has attachments. Change packaging to 'pom'.");
                    getLog().warn("");
                    getLog().warn("Incomplete projects like this will fail in future Maven versions!");
                    getLog().warn("");
                } else {
                    throw new MojoExecutionException("The packaging plugin for this project did not assign "
                            + "a main file to the project but it has attachments. Change packaging to 'pom'.");
                }
            } else {
                throw new MojoExecutionException(
                        "The packaging for this project did not assign a file to the build artifact");
            }
        }

        for (org.apache.maven.artifact.Artifact attached : project.getAttachedArtifacts()) {
            getLog().debug("Attaching for install: " + attached.getId());
            request.addArtifact(RepositoryUtils.toArtifact(attached));
        }
    }