in src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java [287:321]
private void processProject(final MavenProject project, DeployRequest 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 deploy: " + attached.getId());
request.addArtifact(RepositoryUtils.toArtifact(attached));
}
}