You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Walco van Loon <wa...@n--tree.net> on 2006/03/07 20:40:04 UTC

Maven 2 cross mojo Component sharing

Hi list,

I'm currently working on a plugin that gathers build metrics for a bunch
of
projects and generates a one page report for all of them.

For each category of metrics, I've created a mojo which contributes to
the
results using a 'singleton-keep-alive' BuildStore component which I
inject into the mojo's using this snippet:

/**
 * @parameter expression="${component.storage.BuildStore}"
 */
private BuildStore buildStore;

Now my problem is that the BuildStore component is instantiated once for
each
mojo, while I would have expected it to be instantiated once in the Plexus
container's lifecycle, and the same instance would be available to all
mojo's
that reference it.

Is this a feature? If so, what would be the way to achieve cross mojo
data sharing (apart from serialization strategies)?

Thanks in advance for thoughts and answers.

Cheers,
Walco

More relevant info:
I've configured the plexus component using:

<component-set>
  <components>
    <component>
      <role>storage.BuildStore</role>
      <role-hint>build-store</role-hint>
      <implementation>storage.DBStore</implementation>
     
<instantiation-strategy>singleton-keep-alive</instantiation-strategy>
    </component>
  </components>
</component-set>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2 cross mojo Component sharing

Posted by Walco van Loon <wa...@n--tree.net>.
>Please see my mail in the last 2 days about the "dashboard plugin" to
>this list.

Missed that message, thanks!

Cheers,
Walco

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 2 cross mojo Component sharing

Posted by Brett Porter <br...@apache.org>.
Please see my mail in the last 2 days about the "dashboard plugin" to
this list.

Thanks,
Brett

Walco van Loon wrote:
> Hi list,
> 
> I'm currently working on a plugin that gathers build metrics for a bunch
> of
> projects and generates a one page report for all of them.
> 
> For each category of metrics, I've created a mojo which contributes to
> the
> results using a 'singleton-keep-alive' BuildStore component which I
> inject into the mojo's using this snippet:
> 
> /**
>  * @parameter expression="${component.storage.BuildStore}"
>  */
> private BuildStore buildStore;
> 
> Now my problem is that the BuildStore component is instantiated once for
> each
> mojo, while I would have expected it to be instantiated once in the Plexus
> container's lifecycle, and the same instance would be available to all
> mojo's
> that reference it.
> 
> Is this a feature? If so, what would be the way to achieve cross mojo
> data sharing (apart from serialization strategies)?
> 
> Thanks in advance for thoughts and answers.
> 
> Cheers,
> Walco
> 
> More relevant info:
> I've configured the plexus component using:
> 
> <component-set>
>   <components>
>     <component>
>       <role>storage.BuildStore</role>
>       <role-hint>build-store</role-hint>
>       <implementation>storage.DBStore</implementation>
>      
> <instantiation-strategy>singleton-keep-alive</instantiation-strategy>
>     </component>
>   </components>
> </component-set>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org