Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] evaluate Aether-retrieved POM?

Yes, ModelBuilder looks promising.
Following Brett's snippet [1] I run into the question how to get a hold of a ModelResolver.

My code (currently) is in a Maven Mojo following [2], so I'm able to get Aether playing.
I suspect there's a way to get the same ModelResolver as my Mojo uses.
Just couldn't find out how.

Can you help?

Context: For now I have tabled the approach of getting everything working in OSGi.
Instead I put my logic into a Mojo and invoke Maven via exec from OSGi.
The Mojo produces JSon on stderr which is served out by an OSGi-based REST service.
Yes, it's ugly, but it's just a first quick proof of concept.
Eventually it will be all OSGi-based.

Thanks!
-Max

[1] http://stackoverflow.com/questions/4838591/is-there-a-library-for-reading-maven2-3-pom-xml-files#4881362
[2] https://docs.sonatype.org/display/AETHER/Home


On 02/08/2012 05:25 PM, Benjamin Bentmann wrote:
Max Spring wrote:

After I have resolved an artifact successfully with Aether is there a
way I can access other elements of that artifact's POM?
E.g. like the URL or SCM element of the POM.

No, you need to reach out to the ModelBuilder component from maven-model-builder.

Because I can get the dependencies of an artifact via Aether, I would
assume that Aether does some POM evaluation / interpolation
to calculate the correct dependency values. I'm therefore guess that I
may be able to access the entire POM DOM.

The thought is generally not wrong but there is currently no means in the API that would allow you to grab the POM DOM that was used for the dependencies.


Benjamin
_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aether-users




Back to the top