You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2021/03/04 07:02:00 UTC

[jira] [Comment Edited] (MDEP-738) Can't copy dependency from a 3rd party repository

    [ https://issues.apache.org/jira/browse/MDEP-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295039#comment-17295039 ] 

Herve Boutemy edited comment on MDEP-738 at 3/4/21, 7:01 AM:
-------------------------------------------------------------

ok, I didn't get the full details: now I understand

bq. AFAIU, the problem here is that :copy has no idea which alternative metadata file names to try because it has no information on the repository IDs that were being used. Either the repository IDs shall be read and considered from _remote.repositories, or the user should be able to specify them as an input to the plugin.

I think you have found the global root cause and solutions: I suppose maven-dependency-plugin is more often used in the context of a pom.xml with its dependencies, where there repositories ids are defined, but in your case, the algorithm has to be defined

I'll move this issue to MDEP, because the issue is in maven-dependency-plugin

I don't have deep experience on this plugin: source code is https://github.com/apache/maven-dependency-plugin
build and run integration tests is: "mvn -Prun-its verify" (you can filter integration tests with "-Dinvoker.test=...", see the last section of https://maven.apache.org/plugins/maven-invoker-plugin/usage.html )
there is a "copy-cli" IT that looks like your use case: https://github.com/apache/maven-dependency-plugin/tree/master/src/it/projects/copy-cli , I don't know how your case is different


was (Author: hboutemy):
ok, I didn't get the full details: now I understand

bq. AFAIU, the problem here is that :copy has no idea which alternative metadata file names to try because it has no information on the repository IDs that were being used. Either the repository IDs shall be read and considered from _remote.repositories, or the user should be able to specify them as an input to the plugin.

I think you have found the global root cause and solutions: maven-dependency-plugin is more often used in the context of a pom.xml with its dependencies, where there repositories ids are defined, but in your case, the algorithm has to be defined

I'll move this issue to MDEP, because the issue is in maven-dependency-plugin

> Can't copy dependency from a 3rd party repository
> -------------------------------------------------
>
>                 Key: MDEP-738
>                 URL: https://issues.apache.org/jira/browse/MDEP-738
>             Project: Maven Dependency Plugin
>          Issue Type: Improvement
>          Components: copy
>    Affects Versions: 3.1.2
>         Environment: Linux (fc33)
>            Reporter: Pawel Veselov
>            Priority: Major
>         Attachments: copy-X.txt, get-X.txt
>
>
> I can't seem to be able to copy a dependency that I previously downloaded from a 3rd party repository, when referring to it using metaversion.
> This doesn't work, unless I refer to the version directly in the :copy invocation:
> {noformat}
> $ # rm -rf ~/.m2/repository/org/openconext/ # clean up
> $ mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
> -DremoteRepositories=excelfore.public::::https://dev-esync.excelfore.com/artifactory/excelfore.public \
> -Dartifact=org.openconext:mujina-idp:LATEST:jar
> $ mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy \
> -Dartifact=org.openconext:mujina-idp:LATEST:jar -DoutputDirectory=/tmp
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy (default-cli) on project standalone-pom: Unable to find/resolve artifact.: Failed to read artifact descriptor for org.openconext:mujina-idp:jar:LATEST: Failed to resolve version for org.openconext:mujina-idp:jar:LATEST: Could not find metadata org.openconext:mujina-idp/maven-metadata.xml in local (/home/vps/.m2/repository) -> [Help 1]
> {noformat}
> (this is from a real public repo)
> I figure this has something to do with the fact that plugin has no knowledge of the repository ID, and needs it to find the right metadata file. So maybe the plugin should have "repositoryId" property that can be supplied to it so it knows which metadata file to check.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)