You don't need an instance of the MavenProject to parse it, you need only to make it into a Model object... which has a file reader named MavenXpp3Reader, IIRC.

Hope that helps and good luck on your m1 conversion.


^_^


christian domsch (innoWake gmbh) wrote:
Hi all,

I have a mojo that has to analyse its artifacts and the corresponding
poms. I aquire the list of artifacts from a parameter and now I want to
read the pom for each artefact. Since I can get the file for an
artefact, getting the pom is fairely easy, since I only have to change
the file extension. Now I want to access some information inside the pom
I don't want to parse the information myself. So I wanted to know how I
can get an instance of MavenProject for instance from a give pom file.

But maybe I should ask differently: I am converting a Maven 1 plugin to
a Maven 2 Mojo. In the old poms, each dependency had some properties.
Now as I see, these per dependency properties do now exit anymore, maybe
because of the transitiveness of dependencies. But I have to use some
sort oe equivilant mechanismus. What I want to do, is iterate over my
project dependencies and obfuscate the libraries, but only if the
dependency has a property attached.

For the case that there are no more dependency properties, I had the
idea to put that property inside the pom that builds the artefact behind
the dependency and somehow evaluate this property. But I don't know, how
to get this property in the right way.

Any ideas or suggestions?

Greetings, Christian



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to