Good day to you, Jonas,
The way I see it, you have 4 choices here:
1. Instantiate a MavenProject and set all properties you need from it.
2. Use MavenProjectStub (but this is for testing only as Maria has
indicated)
3. Do something like:
/**
* The maven project.
*
* @parameter expression="${project}"
* @readonly
*/
protected MavenProject project;
And this will get your current project
4. Do this
/**
* Project builder
*
* @component
*/
protected MavenProjectBuilder mavenProjectBuilder;
And use mavenProjectBuilder to build a MavenProject.
Cheers,
Franz
Maria Odea Ching wrote:
>
> Hi Jonas,
>
> There's a MavenProjectStub class available in the
> maven-plugin-testing-harness if you're interested. But
> its basically used for plugin testing. I'm not sure if it would be
> useful for you, but you can take a look at it here:
> http://svn.apache.org/repos/asf/maven/shared/trunk/maven-plugin-testing-harness
>
> Hope this helps! :-)
>
> Thanks,
> Deng
>
> Jonas Olsson wrote:
>
>>Hi!
>>
>>This could be a no-no, but can I create a MavenProject object from a POM
>>(other than the one executed) within my plugin?
>>I've traversed the JavaDocs, but there is no obvious way (all methods
>>require arguments I cannot provide, e.g. ProfileManager).
>>
>>/jonas
>>****************************************************************************
>>Detta e-mail har blivit undersökt av http://www.virus112.se
>>****************************************************************************
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Creating-MavenProject-within-plugin-tf2601500s177.html#a7275985
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]