You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Aaron Dixon <at...@gmail.com> on 2013/01/30 20:15:58 UTC

Passing State Between Plugin Executions

I am developing a plugin with "start" and "stop" goals to be executed
typically in pre-integration-test and post-integration-test phases,
respectively.

For example, the "start" execution will discover a port that I'd like the
"stop" execution to know.

Of course, I could use a file or possibly static state to share this value
-- but I am wondering if there is a first-class idiom for doing this?

Thanks for any advise!

Re: Passing State Between Plugin Executions

Posted by Aaron Dixon <at...@gmail.com>.
Excellent, thanks all for the quick help!


On Wed, Jan 30, 2013 at 3:09 PM, Robert Scholte <rf...@apache.org>wrote:

> I would use http://maven.apache.org/ref/3.**0.4/maven-plugin-api/apidocs/*
> *org/apache/maven/plugin/**AbstractMojo.html#**getPluginContext()<http://maven.apache.org/ref/3.0.4/maven-plugin-api/apidocs/org/apache/maven/plugin/AbstractMojo.html#getPluginContext()>
>
> Robert
>
> Op Wed, 30 Jan 2013 20:36:47 +0100 schreef Stephen Connolly <
> stephen.alan.connolly@gmail.**com <st...@gmail.com>>:
>
>
>  You can stash it in the MavenSession IIRC
>>
>> On Wednesday, 30 January 2013, Brian Fox wrote:
>>
>>  The enforcer plugin uses a static array to hold data between executions.
>>>
>>>
>>> On Wed, Jan 30, 2013 at 2:15 PM, Aaron Dixon <atdixon@gmail.com
>>> <javascript:**;>>
>>> wrote:
>>>
>>> > I am developing a plugin with "start" and "stop" goals to be executed
>>> > typically in pre-integration-test and post-integration-test phases,
>>>
>>
>>  respectively.
>>> >
>>> > For example, the "start" execution will discover a port that I'd like
>>> the
>>> > "stop" execution to know.
>>> >
>>> > Of course, I could use a file or possibly static state to share this
>>> value
>>> > -- but I am wondering if there is a first-class idiom for doing this?
>>> >
>>> > Thanks for any advise!
>>> >
>>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.**org<de...@maven.apache.org>
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Passing State Between Plugin Executions

Posted by Robert Scholte <rf...@apache.org>.
I would use  
http://maven.apache.org/ref/3.0.4/maven-plugin-api/apidocs/org/apache/maven/plugin/AbstractMojo.html#getPluginContext()

Robert

Op Wed, 30 Jan 2013 20:36:47 +0100 schreef Stephen Connolly  
<st...@gmail.com>:

> You can stash it in the MavenSession IIRC
>
> On Wednesday, 30 January 2013, Brian Fox wrote:
>
>> The enforcer plugin uses a static array to hold data between executions.
>>
>>
>> On Wed, Jan 30, 2013 at 2:15 PM, Aaron Dixon  
>> <atdixon@gmail.com<javascript:;>>
>> wrote:
>>
>> > I am developing a plugin with "start" and "stop" goals to be executed
>> > typically in pre-integration-test and post-integration-test phases,
>
>> respectively.
>> >
>> > For example, the "start" execution will discover a port that I'd like  
>> the
>> > "stop" execution to know.
>> >
>> > Of course, I could use a file or possibly static state to share this
>> value
>> > -- but I am wondering if there is a first-class idiom for doing this?
>> >
>> > Thanks for any advise!
>> >

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


Re: Passing State Between Plugin Executions

Posted by Stephen Connolly <st...@gmail.com>.
You can stash it in the MavenSession IIRC

On Wednesday, 30 January 2013, Brian Fox wrote:

> The enforcer plugin uses a static array to hold data between executions.
>
>
> On Wed, Jan 30, 2013 at 2:15 PM, Aaron Dixon <atdixon@gmail.com<javascript:;>>
> wrote:
>
> > I am developing a plugin with "start" and "stop" goals to be executed
> > typically in pre-integration-test and post-integration-test phases,

> respectively.
> >
> > For example, the "start" execution will discover a port that I'd like the
> > "stop" execution to know.
> >
> > Of course, I could use a file or possibly static state to share this
> value
> > -- but I am wondering if there is a first-class idiom for doing this?
> >
> > Thanks for any advise!
> >
>

Re: Passing State Between Plugin Executions

Posted by Brian Fox <br...@infinity.nu>.
The enforcer plugin uses a static array to hold data between executions.


On Wed, Jan 30, 2013 at 2:15 PM, Aaron Dixon <at...@gmail.com> wrote:

> I am developing a plugin with "start" and "stop" goals to be executed
> typically in pre-integration-test and post-integration-test phases,
> respectively.
>
> For example, the "start" execution will discover a port that I'd like the
> "stop" execution to know.
>
> Of course, I could use a file or possibly static state to share this value
> -- but I am wondering if there is a first-class idiom for doing this?
>
> Thanks for any advise!
>