You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jesse Glick (Jira)" <ji...@apache.org> on 2020/01/03 16:01:00 UTC
[jira] [Created] (MDEP-667) dependency:sources skips
*--test-sources.jar by default
Jesse Glick created MDEP-667:
--------------------------------
Summary: dependency:sources skips *--test-sources.jar by default
Key: MDEP-667
URL: https://issues.apache.org/jira/browse/MDEP-667
Project: Maven Dependency Plugin
Issue Type: Bug
Components: sources
Affects Versions: 3.1.1
Reporter: Jesse Glick
Save the following to {{/tmp/bug/Dockerfile}}:
{code:none}
FROM maven:3.6.3-jdk-8
RUN git clone -b support-core-2.65 https://github.com/jenkinsci/support-core-plugin /src
WORKDIR /src
RUN git checkout HEAD^
RUN mvn -B validate
RUN mvn dependency:build-classpath | tee /classpath
RUN ls -lR ~/.m2/repository/org/jenkins-ci/plugins/workflow/workflow-support | tee /before
RUN mvn dependency:sources
RUN ls -lR ~/.m2/repository/org/jenkins-ci/plugins/workflow/workflow-support | tee /after
RUN diff /before /after | tee /diff
RUN mvn dependency:sources -Dclassifier=test-sources -DincludeArtifactIds=workflow-support
RUN ls -lR ~/.m2/repository/org/jenkins-ci/plugins/workflow/workflow-support | tee /workaround
RUN diff /after /workaround | tee /diff-workaround
{code}
Now {{docker build /tmp/bug}} and you will see the problem: sources for [this dependency|https://github.com/jenkinsci/support-core-plugin/blob/086d28109a56e3464f7a46036ba35827e03d33b3/pom.xml#L171-L176] are omitted. The {{dependency:sources}} downloads sources for the main artifact:
{code:none}
> -rw-r--r-- 1 root root 91116 Jan 3 15:47 workflow-support-3.3-sources.jar
{code}
after printing
{code:none}
[INFO] The following files have been resolved:
...
[INFO] org.jenkins-ci.plugins.workflow:workflow-support:jar:sources:3.3
...
[INFO] The following files have NOT been resolved:
...
[INFO] org.jenkins-ci.plugins.workflow:workflow-support:jar:3.3:test
...
[INFO] org.jenkins-ci.plugins.workflow:workflow-support:jar:tests:3.3:test
{code}
but only the workaround command suffices to get sources for the test JAR:
{code:none}
> -rw-r--r-- 1 root root 33273 Jan 3 15:51 workflow-support-3.3-test-sources.jar
{code}
after printing
{code:none}
[INFO] The following files have been resolved:
[INFO] org.jenkins-ci.plugins.workflow:workflow-support:jar:test-sources:3.3
[INFO]
[INFO] The following files have NOT been resolved:
[INFO] org.jenkins-ci.plugins.workflow:workflow-support:jar:3.3:test
[INFO] org.jenkins-ci.plugins.workflow:workflow-support:jar:tests:3.3:test
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)