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

ASF GitHub Bot commented on MRESOLVER-307:
------------------------------------------

gnodet commented on code in PR #230:
URL: https://github.com/apache/maven-resolver/pull/230#discussion_r1081330592


##########
maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java:
##########
@@ -55,4 +60,11 @@
      */
     List<String> findVersions( Artifact artifact );
 
+    /**
+     * List all available artifacts this workspace repository manages.
+     * 
+     * @return a stream of artifacts in no particular order
+     */
+    Stream<Artifact> listArtifacts();

Review Comment:
   > Eclipse-plugin never calls that API, 
   >resolver does 
   
   Where ? That's exactly my point.  I can't see any usage of this new method.  
If really needed, it should be provided by maven, not the resolver it seems.
   
   >and possibly maven-plugins call it (that run in the IDE but are not 
developed by the IDE maintainers).
   > 
   > The rationale is to allow for a `maven-plugin` to discover all projects 
(e.g. in a reactor build or IDE), currently one can only call 
`MavenSession.getProjects()` / `MavenSession.getAllProjects()` but these are 
usually populated for different purpose (e.g. `-am` / `-amd`) and require 
MavenProjects to be setup (so no way to find out "artifacts" only).
   
   Yes, and the projects listed has changed in maven 4.x, and I'm working on 
another change.  So if this method is to be used for anything else than a hint, 
it should be more clear about the artifacts returned or how the return stream 
can be used imho.
   
   > 
   > e.g. in Eclipse PDE there is a "TargetPlatform", that contains all 
available artifacts a project can resolve and projects then can use these to 
resolve their dependencies, also this is something where it could be used and 
Tycho currently exposes this with a special component (that obviously only 
plugins can use that "know" Tycho/PDE).
   > 
   > So this is more "maven" generic, just think about my build fails with
   > 
   > > can't find my.atifact in any remote-repository
   > 
   > I can write a plugin that scans all artifacts using fuzzy-search and gives 
a message:
   > 
   > > Did you probabbly mean `my.artifact` instead of `my.atifact`
   
   Sounds good, but if the implementation simply iterates on all projects, not 
sure why adding it here since this has nothing to do with the resolver really.





> Support listing of workspace artifacts
> --------------------------------------
>
>                 Key: MRESOLVER-307
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-307
>             Project: Maven Resolver
>          Issue Type: Improvement
>            Reporter: Christoph Läubrich
>            Priority: Major
>
> Currently the WorkspaceReader has a way to list versions or resolve the file 
> for an artifact, but there is no way of really get a list of workspace 
> artifacts itself.
> The javadoc states:
> {quote}Manages a repository backed by the IDE workspace, a build session or a 
> similar ad-hoc collection of artifacts.{quote}
> so the goal is to have a way getting hold of the "collection of artifacts" 
> this Workspacereader manages.



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

Reply via email to