You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Gilday <ma...@imap.cc> on 2007/02/24 16:35:30 UTC

Mojos in languages other than Java

Hi,

I am trying to write a mojo in Groovy.  According to the mojo api docs
[1] this should be possible (it only meantions BeanShell explicitly). 
However when I package my mojo the resulting plugin.xml is incorrect
showing now mojos.  Consequently when I try and run the plugin a
NullPointer is thrown.  I have tried writing my own plugin.xml and
manually placing it in src/main/resources/META-INF/maven/ but when
package is run it os overridden by the Maven generated one.  I am
assuming Maven reads the annotations from *.java source files and
ignoring my *.groovy files (which I am compiling down to *.class before
packaging).

Has anyone written a mojo in a language other than Java, or is there any
documentation on doing so?

Thanks,
Martin.

[1]http://maven.apache.org/developers/mojo-api-specification.html

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


Re: Mojos in languages other than Java

Posted by Martin Gilday <ma...@imap.cc>.
I managed to successfully create and run mojos written in Groovy. I have
chronicled my findings here
http://www.martingilday.org/articles/Groovy+Maven+Mojos.
Hopefully this will be useful to someone.

Cheers,
Martin Gilday.

----- Original message -----
From: "Tony Ambrozie" <to...@gmail.com>
To: "Maven Users List" <us...@maven.apache.org>
Date: Sat, 24 Feb 2007 13:10:59 -0700
Subject: Re: Mojos in languages other than Java

On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
>
> Thanks for the pointers.  There doesn't seem to be any instructions with
> the groovy-maven-plugin as there are with the jruby one.


Any chances you may formalize your findings in a similar fashion with
the
ruby doc :-)  I, for one, would find it useful...

Looking in the
> source of it there does not appear to be an equivalent of RubyMojo.  I
> might take this to the mojo mailing list.
>
> Thanks again,
> Martin.
>
>
> ----- Original message -----
> From: "Jason van Zyl" <ja...@maven.org>
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Sat, 24 Feb 2007 12:44:53 -0500
> Subject: Re: Mojos in languages other than Java
>
>
> On 24 Feb 07, at 12:16 PM 24 Feb 07, Eric Redmond wrote:
>
> > Follow the same guildlines, just with the Groovy projects instead:
> >
>
> I'm not sure anyone has actually used the Groovy Component Factory in
> Plexus. I think Jeff Genender made another infrastructure for writing
> Groovy plugins. I know Plexus components can be written in Groovy,
> not sure if anyone has tried the native plexus way for actually
> writing Mojos.
>
> jason.
>
> > http://mojo.codehaus.org/jruby-maven-plugin/howto.html
> >
> > Eric
> >
> > On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
> >>
> >> Managed to get it working.  Had to change packaging from maven-plugin
> >> back to jar, so I can now write my own plugin.xml.
> >> Still not ideal as lose the benefit of it being generated from
> >> annotations.  So if any one has a way of doing that it would be
> >> apprecitated.
> >>
> >> Thanks,
> >> Martin.
> >>
> >>
> >> ----- Original message -----
> >> From: "Martin Gilday" <ma...@imap.cc>
> >> To: users@maven.apache.org
> >> Date: Sat, 24 Feb 2007 15:35:30 +0000
> >> Subject: Mojos in languages other than Java
> >>
> >> Hi,
> >>
> >> I am trying to write a mojo in Groovy.  According to the mojo api
> >> docs
> >> [1] this should be possible (it only meantions BeanShell explicitly).
> >> However when I package my mojo the resulting plugin.xml is incorrect
> >> showing now mojos.  Consequently when I try and run the plugin a
> >> NullPointer is thrown.  I have tried writing my own plugin.xml and
> >> manually placing it in src/main/resources/META-INF/maven/ but when
> >> package is run it os overridden by the Maven generated one.  I am
> >> assuming Maven reads the annotations from *.java source files and
> >> ignoring my *.groovy files (which I am compiling down to *.class
> >> before
> >> packaging).
> >>
> >> Has anyone written a mojo in a language other than Java, or is
> >> there any
> >> documentation on doing so?
> >>
> >> Thanks,
> >> Martin.
> >>
> >> [1]http://maven.apache.org/developers/mojo-api-specification.html
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >>
> >>
> >
> >
> > --
> > Eric Redmond
> > http://codehaus.org/~eredmond
>
>
> ---------------------------------------------------------------------
> 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
>
>

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


Re: Mojos in languages other than Java

Posted by Martin Gilday <ma...@imap.cc>.
If I get anywhere I will :)

Eric I had a look at the JRuby guide.  I do not think I can simply
substitute in the groovy-maven-plugin.  I have asked Jeff Genender (its
creator) and he says it does not support this.  Looking at the jruby
plugin it seems I would need to extend
AbstractScriptedMojoDescriptorExtractor.

I also found this http://jira.codehaus.org/browse/MNG-1664 which I think
might have been what Jason was referring to?

----- Original message -----
From: "Tony Ambrozie" <to...@gmail.com>
To: "Maven Users List" <us...@maven.apache.org>
Date: Sat, 24 Feb 2007 13:10:59 -0700
Subject: Re: Mojos in languages other than Java

On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
>
> Thanks for the pointers.  There doesn't seem to be any instructions with
> the groovy-maven-plugin as there are with the jruby one.


Any chances you may formalize your findings in a similar fashion with
the
ruby doc :-)  I, for one, would find it useful...

Looking in the
> source of it there does not appear to be an equivalent of RubyMojo.  I
> might take this to the mojo mailing list.
>
> Thanks again,
> Martin.
>
>
> ----- Original message -----
> From: "Jason van Zyl" <ja...@maven.org>
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Sat, 24 Feb 2007 12:44:53 -0500
> Subject: Re: Mojos in languages other than Java
>
>
> On 24 Feb 07, at 12:16 PM 24 Feb 07, Eric Redmond wrote:
>
> > Follow the same guildlines, just with the Groovy projects instead:
> >
>
> I'm not sure anyone has actually used the Groovy Component Factory in
> Plexus. I think Jeff Genender made another infrastructure for writing
> Groovy plugins. I know Plexus components can be written in Groovy,
> not sure if anyone has tried the native plexus way for actually
> writing Mojos.
>
> jason.
>
> > http://mojo.codehaus.org/jruby-maven-plugin/howto.html
> >
> > Eric
> >
> > On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
> >>
> >> Managed to get it working.  Had to change packaging from maven-plugin
> >> back to jar, so I can now write my own plugin.xml.
> >> Still not ideal as lose the benefit of it being generated from
> >> annotations.  So if any one has a way of doing that it would be
> >> apprecitated.
> >>
> >> Thanks,
> >> Martin.
> >>
> >>
> >> ----- Original message -----
> >> From: "Martin Gilday" <ma...@imap.cc>
> >> To: users@maven.apache.org
> >> Date: Sat, 24 Feb 2007 15:35:30 +0000
> >> Subject: Mojos in languages other than Java
> >>
> >> Hi,
> >>
> >> I am trying to write a mojo in Groovy.  According to the mojo api
> >> docs
> >> [1] this should be possible (it only meantions BeanShell explicitly).
> >> However when I package my mojo the resulting plugin.xml is incorrect
> >> showing now mojos.  Consequently when I try and run the plugin a
> >> NullPointer is thrown.  I have tried writing my own plugin.xml and
> >> manually placing it in src/main/resources/META-INF/maven/ but when
> >> package is run it os overridden by the Maven generated one.  I am
> >> assuming Maven reads the annotations from *.java source files and
> >> ignoring my *.groovy files (which I am compiling down to *.class
> >> before
> >> packaging).
> >>
> >> Has anyone written a mojo in a language other than Java, or is
> >> there any
> >> documentation on doing so?
> >>
> >> Thanks,
> >> Martin.
> >>
> >> [1]http://maven.apache.org/developers/mojo-api-specification.html
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >>
> >>
> >
> >
> > --
> > Eric Redmond
> > http://codehaus.org/~eredmond
>
>
> ---------------------------------------------------------------------
> 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
>
>

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


Re: Mojos in languages other than Java

Posted by Tony Ambrozie <to...@gmail.com>.
On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
>
> Thanks for the pointers.  There doesn't seem to be any instructions with
> the groovy-maven-plugin as there are with the jruby one.


Any chances you may formalize your findings in a similar fashion with the
ruby doc :-)  I, for one, would find it useful...

Looking in the
> source of it there does not appear to be an equivalent of RubyMojo.  I
> might take this to the mojo mailing list.
>
> Thanks again,
> Martin.
>
>
> ----- Original message -----
> From: "Jason van Zyl" <ja...@maven.org>
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Sat, 24 Feb 2007 12:44:53 -0500
> Subject: Re: Mojos in languages other than Java
>
>
> On 24 Feb 07, at 12:16 PM 24 Feb 07, Eric Redmond wrote:
>
> > Follow the same guildlines, just with the Groovy projects instead:
> >
>
> I'm not sure anyone has actually used the Groovy Component Factory in
> Plexus. I think Jeff Genender made another infrastructure for writing
> Groovy plugins. I know Plexus components can be written in Groovy,
> not sure if anyone has tried the native plexus way for actually
> writing Mojos.
>
> jason.
>
> > http://mojo.codehaus.org/jruby-maven-plugin/howto.html
> >
> > Eric
> >
> > On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
> >>
> >> Managed to get it working.  Had to change packaging from maven-plugin
> >> back to jar, so I can now write my own plugin.xml.
> >> Still not ideal as lose the benefit of it being generated from
> >> annotations.  So if any one has a way of doing that it would be
> >> apprecitated.
> >>
> >> Thanks,
> >> Martin.
> >>
> >>
> >> ----- Original message -----
> >> From: "Martin Gilday" <ma...@imap.cc>
> >> To: users@maven.apache.org
> >> Date: Sat, 24 Feb 2007 15:35:30 +0000
> >> Subject: Mojos in languages other than Java
> >>
> >> Hi,
> >>
> >> I am trying to write a mojo in Groovy.  According to the mojo api
> >> docs
> >> [1] this should be possible (it only meantions BeanShell explicitly).
> >> However when I package my mojo the resulting plugin.xml is incorrect
> >> showing now mojos.  Consequently when I try and run the plugin a
> >> NullPointer is thrown.  I have tried writing my own plugin.xml and
> >> manually placing it in src/main/resources/META-INF/maven/ but when
> >> package is run it os overridden by the Maven generated one.  I am
> >> assuming Maven reads the annotations from *.java source files and
> >> ignoring my *.groovy files (which I am compiling down to *.class
> >> before
> >> packaging).
> >>
> >> Has anyone written a mojo in a language other than Java, or is
> >> there any
> >> documentation on doing so?
> >>
> >> Thanks,
> >> Martin.
> >>
> >> [1]http://maven.apache.org/developers/mojo-api-specification.html
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >>
> >>
> >
> >
> > --
> > Eric Redmond
> > http://codehaus.org/~eredmond
>
>
> ---------------------------------------------------------------------
> 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: Mojos in languages other than Java

Posted by Martin Gilday <ma...@imap.cc>.
Thanks for the pointers.  There doesn't seem to be any instructions with
the groovy-maven-plugin as there are with the jruby one.  Looking in the
source of it there does not appear to be an equivalent of RubyMojo.  I
might take this to the mojo mailing list.

Thanks again,
Martin.


----- Original message -----
From: "Jason van Zyl" <ja...@maven.org>
To: "Maven Users List" <us...@maven.apache.org>
Date: Sat, 24 Feb 2007 12:44:53 -0500
Subject: Re: Mojos in languages other than Java


On 24 Feb 07, at 12:16 PM 24 Feb 07, Eric Redmond wrote:

> Follow the same guildlines, just with the Groovy projects instead:
>

I'm not sure anyone has actually used the Groovy Component Factory in  
Plexus. I think Jeff Genender made another infrastructure for writing  
Groovy plugins. I know Plexus components can be written in Groovy,  
not sure if anyone has tried the native plexus way for actually  
writing Mojos.

jason.

> http://mojo.codehaus.org/jruby-maven-plugin/howto.html
>
> Eric
>
> On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
>>
>> Managed to get it working.  Had to change packaging from maven-plugin
>> back to jar, so I can now write my own plugin.xml.
>> Still not ideal as lose the benefit of it being generated from
>> annotations.  So if any one has a way of doing that it would be
>> apprecitated.
>>
>> Thanks,
>> Martin.
>>
>>
>> ----- Original message -----
>> From: "Martin Gilday" <ma...@imap.cc>
>> To: users@maven.apache.org
>> Date: Sat, 24 Feb 2007 15:35:30 +0000
>> Subject: Mojos in languages other than Java
>>
>> Hi,
>>
>> I am trying to write a mojo in Groovy.  According to the mojo api  
>> docs
>> [1] this should be possible (it only meantions BeanShell explicitly).
>> However when I package my mojo the resulting plugin.xml is incorrect
>> showing now mojos.  Consequently when I try and run the plugin a
>> NullPointer is thrown.  I have tried writing my own plugin.xml and
>> manually placing it in src/main/resources/META-INF/maven/ but when
>> package is run it os overridden by the Maven generated one.  I am
>> assuming Maven reads the annotations from *.java source files and
>> ignoring my *.groovy files (which I am compiling down to *.class  
>> before
>> packaging).
>>
>> Has anyone written a mojo in a language other than Java, or is  
>> there any
>> documentation on doing so?
>>
>> Thanks,
>> Martin.
>>
>> [1]http://maven.apache.org/developers/mojo-api-specification.html
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>
>
> -- 
> Eric Redmond
> http://codehaus.org/~eredmond


---------------------------------------------------------------------
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: Mojos in languages other than Java

Posted by Jason van Zyl <ja...@maven.org>.
On 24 Feb 07, at 12:16 PM 24 Feb 07, Eric Redmond wrote:

> Follow the same guildlines, just with the Groovy projects instead:
>

I'm not sure anyone has actually used the Groovy Component Factory in  
Plexus. I think Jeff Genender made another infrastructure for writing  
Groovy plugins. I know Plexus components can be written in Groovy,  
not sure if anyone has tried the native plexus way for actually  
writing Mojos.

jason.

> http://mojo.codehaus.org/jruby-maven-plugin/howto.html
>
> Eric
>
> On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
>>
>> Managed to get it working.  Had to change packaging from maven-plugin
>> back to jar, so I can now write my own plugin.xml.
>> Still not ideal as lose the benefit of it being generated from
>> annotations.  So if any one has a way of doing that it would be
>> apprecitated.
>>
>> Thanks,
>> Martin.
>>
>>
>> ----- Original message -----
>> From: "Martin Gilday" <ma...@imap.cc>
>> To: users@maven.apache.org
>> Date: Sat, 24 Feb 2007 15:35:30 +0000
>> Subject: Mojos in languages other than Java
>>
>> Hi,
>>
>> I am trying to write a mojo in Groovy.  According to the mojo api  
>> docs
>> [1] this should be possible (it only meantions BeanShell explicitly).
>> However when I package my mojo the resulting plugin.xml is incorrect
>> showing now mojos.  Consequently when I try and run the plugin a
>> NullPointer is thrown.  I have tried writing my own plugin.xml and
>> manually placing it in src/main/resources/META-INF/maven/ but when
>> package is run it os overridden by the Maven generated one.  I am
>> assuming Maven reads the annotations from *.java source files and
>> ignoring my *.groovy files (which I am compiling down to *.class  
>> before
>> packaging).
>>
>> Has anyone written a mojo in a language other than Java, or is  
>> there any
>> documentation on doing so?
>>
>> Thanks,
>> Martin.
>>
>> [1]http://maven.apache.org/developers/mojo-api-specification.html
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>
>
> -- 
> Eric Redmond
> http://codehaus.org/~eredmond


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


Re: Mojos in languages other than Java

Posted by Eric Redmond <er...@gmail.com>.
Follow the same guildlines, just with the Groovy projects instead:

http://mojo.codehaus.org/jruby-maven-plugin/howto.html

Eric

On 2/24/07, Martin Gilday <ma...@imap.cc> wrote:
>
> Managed to get it working.  Had to change packaging from maven-plugin
> back to jar, so I can now write my own plugin.xml.
> Still not ideal as lose the benefit of it being generated from
> annotations.  So if any one has a way of doing that it would be
> apprecitated.
>
> Thanks,
> Martin.
>
>
> ----- Original message -----
> From: "Martin Gilday" <ma...@imap.cc>
> To: users@maven.apache.org
> Date: Sat, 24 Feb 2007 15:35:30 +0000
> Subject: Mojos in languages other than Java
>
> Hi,
>
> I am trying to write a mojo in Groovy.  According to the mojo api docs
> [1] this should be possible (it only meantions BeanShell explicitly).
> However when I package my mojo the resulting plugin.xml is incorrect
> showing now mojos.  Consequently when I try and run the plugin a
> NullPointer is thrown.  I have tried writing my own plugin.xml and
> manually placing it in src/main/resources/META-INF/maven/ but when
> package is run it os overridden by the Maven generated one.  I am
> assuming Maven reads the annotations from *.java source files and
> ignoring my *.groovy files (which I am compiling down to *.class before
> packaging).
>
> Has anyone written a mojo in a language other than Java, or is there any
> documentation on doing so?
>
> Thanks,
> Martin.
>
> [1]http://maven.apache.org/developers/mojo-api-specification.html
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Eric Redmond
http://codehaus.org/~eredmond

Re: Mojos in languages other than Java

Posted by Martin Gilday <ma...@imap.cc>.
Managed to get it working.  Had to change packaging from maven-plugin
back to jar, so I can now write my own plugin.xml.
Still not ideal as lose the benefit of it being generated from
annotations.  So if any one has a way of doing that it would be
apprecitated.

Thanks,
Martin.


----- Original message -----
From: "Martin Gilday" <ma...@imap.cc>
To: users@maven.apache.org
Date: Sat, 24 Feb 2007 15:35:30 +0000
Subject: Mojos in languages other than Java

Hi,

I am trying to write a mojo in Groovy.  According to the mojo api docs
[1] this should be possible (it only meantions BeanShell explicitly). 
However when I package my mojo the resulting plugin.xml is incorrect
showing now mojos.  Consequently when I try and run the plugin a
NullPointer is thrown.  I have tried writing my own plugin.xml and
manually placing it in src/main/resources/META-INF/maven/ but when
package is run it os overridden by the Maven generated one.  I am
assuming Maven reads the annotations from *.java source files and
ignoring my *.groovy files (which I am compiling down to *.class before
packaging).

Has anyone written a mojo in a language other than Java, or is there any
documentation on doing so?

Thanks,
Martin.

[1]http://maven.apache.org/developers/mojo-api-specification.html

---------------------------------------------------------------------
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