Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a magic for load from pom dependencies #58

Open
padreati opened this issue Jul 23, 2024 · 4 comments
Open

Implement a magic for load from pom dependencies #58

padreati opened this issue Jul 23, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@padreati
Copy link
Owner

Implement a magic for load from pom dependencies. A cell magic which is able to parse chunks of dependency declarations from a pom file.

@padreati padreati added the enhancement New feature or request label Jul 23, 2024
@dsyer
Copy link
Contributor

dsyer commented Aug 6, 2024

+1. Might be useful to have it add target/classes automatically as well?

@cstamas
Copy link
Contributor

cstamas commented Sep 3, 2024

Look into "shared" (commando) of Toolbox that is reusable and is in fact MIMA "showcase":
https://github.com/maveniverse/toolbox

@padreati
Copy link
Owner Author

padreati commented Sep 4, 2024

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.

@cstamas
Copy link
Contributor

cstamas commented Sep 4, 2024

Don't bother/focus on/with MIMA 😄 , 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:

  • construct MIMA Context (as today)
  • using Context create your "use cases" extension
  • invoke it, make use of results

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants