[
https://issues.apache.org/jira/browse/MSOURCES-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17754918#comment-17754918
]
Slawomir Jaranowski commented on MSOURCES-143:
----------------------------------------------
I can reproduce ... master on {{commons-cli}}
{code:java}
mvn clean package
[INFO] --- source:3.2.1:jar-no-fork (create-source-jar) @ commons-cli ---
[INFO] Building jar:
/Users/slawomir.jaranowski/repos/apache/commons-cli/target/commons-cli-1.6.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- source:3.2.1:test-jar-no-fork (create-source-jar) @ commons-cli ---
[INFO] Building jar:
/Users/slawomir.jaranowski/repos/apache/commons-cli/target/commons-cli-1.6.0-SNAPSHOT-test-sources.jar
{code}
and with release profile we have:
{code:java}
mvn clean package -P apache-release
[INFO] --- source:3.2.1:jar-no-fork (attach-sources) @ commons-cli ---
[INFO] Building jar:
/Users/slawomir.jaranowski/repos/apache/commons-cli/target/commons-cli-1.6.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- source:3.2.1:jar-no-fork (create-source-jar) @ commons-cli ---
[WARNING] artifact 'commons-cli:commons-cli:java-source:sources:1.6.0-SNAPSHOT'
already attached, replacing previous instance
[INFO]
[INFO] --- source:3.2.1:test-jar-no-fork (create-source-jar) @ commons-cli ---
[INFO] Building jar:
/Users/slawomir.jaranowski/repos/apache/commons-cli/target/commons-cli-1.6.0-SNAPSHOT-test-sources.jar
[INFO]
[INFO] --- source:3.2.1:test-jar (attach-test-sources) @ commons-cli ---
[WARNING] artifact
'commons-cli:commons-cli:java-source:test-sources:1.6.0-SNAPSHOT' already
attached, replacing previous instance
{code}
you execute twice in {{3.2.1}} we see warning ... but in {{3.3.0}} we will have
an error ...
{code}
mvn clean package -P apache-release -Dcommons.source-plugin.version=3.3.0
[INFO] --- source:3.3.0:jar-no-fork (attach-sources) @ commons-cli ---
[INFO] Building jar:
/Users/slawomir.jaranowski/repos/apache/commons-cli/target/commons-cli-1.6.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- source:3.3.0:jar-no-fork (create-source-jar) @ commons-cli ---
[ERROR] We have duplicated artifacts attached.
{code}
so it is not a bug in {{m-source-p}} - simply you try execute the same goal
twice
execution - {{attach-test-sources}} is defined in commons-parent
but {{attach-sources}} is defined in mavem-apache-parent
> Can't create a source and test jar in Commons using commons-parent
> ------------------------------------------------------------------
>
> Key: MSOURCES-143
> URL: https://issues.apache.org/jira/browse/MSOURCES-143
> Project: Maven Source Plugin
> Issue Type: Bug
> Affects Versions: 3.3.0
> Reporter: Gary D. Gregory
> Priority: Major
>
> Steps to reproduce:
> # git clone https://gitbox.apache.org/repos/asf/commons-parent.git
> # cd commons-parent
> # git checkout 8d886ce8382f7a79f06d51a3afc386b8a37d0473
> # mvn clean install
> # cd ..
> # git clone https://gitbox.apache.org/repos/asf/commons-cli.git
> # cd commons-cli
> # git checkout 08f8c5034a8492be6db65b2086341c292489ee53
> # mvn clean package
> [INFO] --- source:3.3.0:jar-no-fork (create-source-jar) @ commons-cli ---
> [ERROR] We have duplicated artifacts attached.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 15.233 s
> [INFO] Finished at: 2023-08-15T15:39:45-04:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-source-plugin:3.3.0:jar-no-fork
> (create-source-jar) on project commons-cli: Presumably you have configured
> maven-source-plugn to execute twice times in your build. You have to
> configure a classifier for at least on of them. -> [Help 1]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)