You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2022/11/11 14:11:00 UTC

[jira] [Commented] (MRESOLVER-271) Delay the download of a file until it is first accessed

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

Tamas Cservenak commented on MRESOLVER-271:
-------------------------------------------

Am really unsure about the intent here... kinda collect and resolve steps are being mixed? Actually, the resolver (in Maven2) was "lazy" and Maven3+ is making it more and more "eager", so this would really go against the plans. Also, what would "resolve" then do, if you expect it to not resolve (but only lazily IF accessed)?

> Delay the download of a file until it is first accessed
> -------------------------------------------------------
>
>                 Key: MRESOLVER-271
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-271
>             Project: Maven Resolver
>          Issue Type: Improvement
>            Reporter: Christoph Läubrich
>            Priority: Major
>
> As described here https://issues.apache.org/jira/browse/MNG-7538 it would be good to have files be "lazy resolved":
> Currently there is {code:java}org.eclipse.aether.artifact.Artifact.setFile(File){code} that is used while resolving an Artifact against a remote repository and that points to an exiting file in the local repository.
> This approach has the drawback, that during resolving an Artifact it needs to be fully downloaded, even though it might not be used (yet) if one likes to find out if it is resolvable and the meta-data would be enough to e.g. resolve it and its dependencies.
> I therefore like to suggest supporting a way of a lazy-download in the following way:
> 1. There is a new method {code:java}org.eclipse.aether.artifact.Artifact.setFileSupplier(Supplier<File> supplier){code} 
> 2.  {code:java}org.eclipse.aether.artifact.Artifact.getFile(){code} first checks if there is a file already set, or otherwise init it by calling the supplier if given
> 3.There is a new method  {code:java}org.eclipse.aether.artifact.Artifact.hasFile(){code} that returns true if there is either a file set or a file supplier



--
This message was sent by Atlassian Jira
(v8.20.10#820010)