Skip to content

Commit

Permalink
[MCOMPILER-559] Warn if overwriting the project's artifact's file to …
Browse files Browse the repository at this point in the history
…a different value (#211)
  • Loading branch information
gnodet authored Nov 23, 2023
1 parent 27cafe6 commit 24c8104
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
Expand Down Expand Up @@ -205,6 +206,10 @@ public void execute() throws MojoExecutionException, CompilationFailureException
super.execute();

if (outputDirectory.isDirectory()) {
File artifactFile = projectArtifact.getFile();
if (artifactFile != null && !Objects.equals(artifactFile, outputDirectory)) {
getLog().warn("Overwriting artifact's file from " + artifactFile + " to " + outputDirectory);
}
projectArtifact.setFile(outputDirectory);
}
}
Expand Down

0 comments on commit 24c8104

Please sign in to comment.