Skip to content

Commit f28099a

Browse files
committed
Fix duplicate attachment of sources artifact
The previous configuration caused the sources to be attached twice via two different goals: once using jar-no-fork, and once using jar. The reason this happened is because pom-scijava-base specified <id>attach-sources</id>, which is aligned with the super POM, which caused the two executions to be _concatenated_, not _replaced_ as I believed would occur. With this change, the following commands both look good to me now: mvn help:effective-pom mvn -Prelease-profile help:effective-pom Both of them now have two executions: * attach-sources from the super POM, overridden to <phase>none</phase>. * attach-sources-jar from pom-scijava-base, using <goal>jar</goal>. With luck, this will make releases of SciJava components work better. The only thing I don't understand is why _any_ releases have been working at all -- in theory, this problems breaks all release builds...
1 parent ba137cd commit f28099a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pom.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,18 @@
470470
<version>${maven-source-plugin.version}</version>
471471
<!-- Build source artifact in addition to main artifact. -->
472472
<executions>
473+
<!--
474+
NB: Attach sources with jar goal, not jar-no-fork, to avoid a bug
475+
where the -sources JAR gets generated and deployed twice. See:
476+
https://issues.apache.org/jira/browse/MNG-5939
477+
-->
473478
<execution>
474479
<id>attach-sources</id>
480+
<phase>none</phase>
481+
</execution>
482+
<execution>
483+
<id>attach-sources-jar</id>
475484
<goals>
476-
<!--
477-
NB: We use jar rather than jar-no-fork to avoid a bug where
478-
the -sources JAR gets generated and deployed twice. See:
479-
https://issues.apache.org/jira/browse/MNG-5939
480-
-->
481485
<goal>jar</goal>
482486
</goals>
483487
</execution>

0 commit comments

Comments
 (0)