On 26/02/2010, at 7:08 PM, pubudu gunawardena wrote:

> I want to to use the maven help plugin classes inside a program I'm writing
> to generate the effective pom. But since the variables are set by Mojo
> parameters ${reactorProjects} and ${project} I cannot accomplish this. Is
> there a way to get these parameters programmatically and pass them to the
> Mojo?


If you're doing it outside of Maven, you'll essentially need to reuse a number 
of the libraries. This isn't strictly supported in the current version, and the 
APIs may change.

That said, an example of how it can be done is shown here: 
http://github.com/brettporter/centrepoint/blob/master/centrepoint/modules/maven-importer/src/main/java/com/effectivemaven/centrepoint/maven/repository/CentralRepositoryService.java

Bear in mind that the loaded projects are cached in memory in Maven 2 and that 
will grow over time.

Depending on what you are trying to achieve, you may find it better to execute 
mvn help:effective-pom externally and capture the output.

Cheers,
Brett

--
Brett Porter
[email protected]
http://brettporter.wordpress.com/





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to