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

Delany edited comment on MDEP-738 at 9/2/22 12:50 PM:
------------------------------------------------------

My requirement was to "download all direct dependencies of a pom at URL to a 
directory". If that pom relies on its parent to configure repositories, and its 
not a SNAPSHOT, its impossible to achieve this using this plugin, either with 3 
cli commands for get/copy/copy-dependencies, or even via a pom.xml

The workaround was to publish the pom with its own repo pointing to the 
third-party repo, do the get/copy with the pom.xml, and copy-dependencies with 
the command.


was (Author: delany):
My requirement was to "download all direct dependencies of a pom at URL to a 
directory". If that pom relies on its parent to configure repositories, and its 
not a SNAPSHOT, its impossible to achieve this using this plugin, either with 3 
cli commands for get/copy/copy-dependencies, or even via a pom.xml

The workaround was to publish the pom with its own repo pointing to the 
third-party repo or a repo to override and block central.

I went with 3 commands each for simplicity. If I'd gone with the pom.xml 
approach, then for each dependency I'd need an execution for the get goal and 
an artifactItem for the copy goal. If I wanted to use the list-repositories 
goal I'd have to specify the dependency yet again as a dependency.

> 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.20.10#820010)

Reply via email to