rmannibucau commented on code in PR #24:
URL: 
https://github.com/apache/maven-source-plugin/pull/24#discussion_r1542398581


##########
src/main/java/org/apache/maven/plugins/source/AbstractSourceJarMojo.java:
##########
@@ -303,15 +304,24 @@ protected void packageSources(List<MavenProject> 
theProjects) throws MojoExecuti
             }
 
             if (attach) {
+                boolean requiresAttach = true;
                 for (Artifact attachedArtifact : 
project.getAttachedArtifacts()) {
-                    if (isAlreadyAttached(attachedArtifact, project, 
getClassifier())) {
-                        getLog().error("We have duplicated artifacts 
attached.");
-                        throw new MojoExecutionException("Presumably you have 
configured maven-source-plugin "
-                                + "to execute twice in your build. You have to 
configure a classifier "
-                                + "for at least one of them.");
+                    Artifact previouslyAttached = 
getPreviouslyAttached(attachedArtifact, project, getClassifier());
+                    if (previouslyAttached != null) {
+                        if (!outputFile.equals(previouslyAttached.getFile())) {

Review Comment:
   @hboutemy just replace it by documentation, if you reread the threads it is 
just people don't understanding maven superpom notion, we did our homework and 
fixed it now it is just a matter of managing the legacy.
   
   @hboutemy @olamy I'm ok with `ignoreAlreadyAttachedArtifact` if it is not a 
`@Parameter` and if it is initialized with `mvn.version == 3` + a comment `must 
be false for maven 4 since see MSOURCES-121 and @github/#24`. I'm not ok to do 
positive enhancements then revert them because we are not able to explain what 
maven does or do a new maven release - literally this PR from my window.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to