You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by laredotornado-3 <la...@gmail.com> on 2011/04/14 21:32:02 UTC

Mojo: How do I write a plugin to interact with another?

Hi,

I'm using Maven 3.0.3.  I want to write a Maven plugin that will ultimately
output a string (in my case, a version control revision number) that will be
used by another plugin (SCM).  How do I pass the value from one place to
another?  FYI, I want the value to be used by the scm:checkout task here ...

      
        org.apache.maven.plugins
        maven-scm-plugin
        1.5
        
          install
          username
          password
          
          revision
        
      

Could someone point me at an example or let me know how this is done? 
Thanks, - Dave


--
View this message in context: http://maven.40175.n5.nabble.com/Mojo-How-do-I-write-a-plugin-to-interact-with-another-tp4303832p4303832.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Mojo: How do I write a plugin to interact with another?

Posted by Anders Hammar <an...@hammar.net>.
Justin reads my mind.

/Anders

On Fri, Apr 15, 2011 at 17:49, Justin Edelson <ju...@justinedelson.com>wrote:

> I don't think that's what Anders is suggesting specifically. He's
> suggesting that you look at how a plugin which already does this
> works. That's the beauty of an ecosystem of open source plugins.
>
> On Fri, Apr 15, 2011 at 7:44 AM, laredotornado-3
> <la...@gmail.com> wrote:
> > Ah, so I understand your idea, you're saying that my plugin should output
> its
> > value to a/the maven.proeprties file and then I can just read that in
> from
> > my other task?
> >
> > - Dave
> >
> > --
> > View this message in context:
> http://maven.40175.n5.nabble.com/Mojo-How-do-I-write-a-plugin-to-interact-with-another-tp4303832p4305730.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Mojo: How do I write a plugin to interact with another?

Posted by Justin Edelson <ju...@justinedelson.com>.
I don't think that's what Anders is suggesting specifically. He's
suggesting that you look at how a plugin which already does this
works. That's the beauty of an ecosystem of open source plugins.

On Fri, Apr 15, 2011 at 7:44 AM, laredotornado-3
<la...@gmail.com> wrote:
> Ah, so I understand your idea, you're saying that my plugin should output its
> value to a/the maven.proeprties file and then I can just read that in from
> my other task?
>
> - Dave
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Mojo-How-do-I-write-a-plugin-to-interact-with-another-tp4303832p4305730.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Mojo: How do I write a plugin to interact with another?

Posted by Zilvinas Vilutis <ci...@gmail.com>.
I think the idea was to set a "maven property" - means not set it to a
file, but to the maven properties in runtime.

Maven should provide an API for that and you can check the source of
"build-helper-maven-plugin" project as an example ;)

Regards

Žilvinas Vilutis

Mobile:   (+370) 652 38353
E-mail:   cikasfm@gmail.com



On Fri, Apr 15, 2011 at 7:44 AM, laredotornado-3
<la...@gmail.com> wrote:
> Ah, so I understand your idea, you're saying that my plugin should output its
> value to a/the maven.proeprties file and then I can just read that in from
> my other task?
>
> - Dave
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Mojo-How-do-I-write-a-plugin-to-interact-with-another-tp4303832p4305730.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Mojo: How do I write a plugin to interact with another?

Posted by laredotornado-3 <la...@gmail.com>.
Ah, so I understand your idea, you're saying that my plugin should output its
value to a/the maven.proeprties file and then I can just read that in from
my other task?

- Dave

--
View this message in context: http://maven.40175.n5.nabble.com/Mojo-How-do-I-write-a-plugin-to-interact-with-another-tp4303832p4305730.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Mojo: How do I write a plugin to interact with another?

Posted by Anders Hammar <an...@hammar.net>.
The build-helper-maven-plugin has the goal reserve-network-port which writes
port numbers to maven properties that can be used within the project. Maybe
that's something to look at?

/Anders

On Thu, Apr 14, 2011 at 21:32, laredotornado-3 <la...@gmail.com>wrote:

> Hi,
>
> I'm using Maven 3.0.3.  I want to write a Maven plugin that will ultimately
> output a string (in my case, a version control revision number) that will
> be
> used by another plugin (SCM).  How do I pass the value from one place to
> another?  FYI, I want the value to be used by the scm:checkout task here
> ...
>
>
>        org.apache.maven.plugins
>        maven-scm-plugin
>        1.5
>
>          install
>          username
>          password
>
>          revision
>
>
>
> Could someone point me at an example or let me know how this is done?
> Thanks, - Dave
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Mojo-How-do-I-write-a-plugin-to-interact-with-another-tp4303832p4303832.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>