Open padreati opened 2 months ago
+1. Might be useful to have it add target/classes
automatically as well?
Look into "shared" (commando) of Toolbox that is reusable and is in fact MIMA "showcase": https://github.com/maveniverse/toolbox
Thank you. I will dive deep into that code base. It should be give me good lessons anyway regarding how MIMA works and should be used in general.
Don't bother/focus on/with MIMA :smile: , it's main goal is to be "man in black" (to not be even be aware you use it). You want to use Maven Resolver 1.x APIs and MIMA merely helps you with to get access to it (and not have to fiddle manually with "creating Resolver, config... etc"). MIMA just simplifies access to three key components: RepositorySystem
, RepositorySystemSession
and remote repositories.
As I mentioned above, you have nice Resolver 1.x examples accessible from here: https://github.com/apache/maven-resolver/tree/maven-resolver-1.9.x/maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples https://github.com/maveniverse/toolbox/tree/main/shared/src/main/java/eu/maveniverse/maven/toolbox/shared/internal (mostly ToolboxResolverImpl and ToolboxCommandoImpl)
But if you identify some "simple and exact" use cases (like "give me the full transitive classpath of artifact GAV) then I could implement it for you in form of some "new extension" to MIMA, just like MMR currently is.
So all you would need to do is:
PS: Don't be confused, there are currently two main branches of Maven Resolver: 2.x is on master branch (latest version 2.0.1) and is used in Maven 4.x, and 1.x that is on branch maven-resolver-1.9.x (latest version 1.9.22) and is used in Maven 3 (and MIMA also).
Implement a magic for load from pom dependencies. A cell magic which is able to parse chunks of dependency declarations from a pom file.