Groovy and Maven 2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
23 messages Options
123
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Groovy and Maven 2

Tomas Hubalek-3
Hello all,

I'm trying Maven 2 and I would like to compile Groovy scripts via Maven 2.

What is easiest way how to do it? In Maven 1 I did it in maven.xml, but
it not in Maven 2 any longer.

If you have any idea or expirience  plase share it.

Thanks a lot
Tom

---------------------------------------------------
Tomas Hubalek, http://blog.hubalek.net/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Guillaume Laforge
Administrator
Excellent question...
I've heard about Groovy plugins (or do we say Mojo?) for Maven 2.
But I've never used them and don't know what they are capable of.
I've found a link on Google on a mailing-list:
http://mail-archives.apache.org/mod_mbox/cocoon-dev/200511.mbox/%3Cdls42k$pol$1@...%3E
But there might be other interesting pages.
Please tell us what you discover on that topic!

On 5/4/06, Tomas Hubalek <[hidden email]> wrote:

> Hello all,
>
> I'm trying Maven 2 and I would like to compile Groovy scripts via Maven 2.
>
> What is easiest way how to do it? In Maven 1 I did it in maven.xml, but
> it not in Maven 2 any longer.
>
> If you have any idea or expirience  plase share it.
>
> Thanks a lot
> Tom
>
> ---------------------------------------------------
> Tomas Hubalek, http://blog.hubalek.net/
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Tomas Hubalek-3
In case that I choice maven 2 and discover something I will post it to
blog and/or to Groovy site...

Have a nice day
Tom

---------------------------------------------------
Tomas Hubalek, http://blog.hubalek.net/

Guillaume Laforge napsal(a):

> Excellent question...
> I've heard about Groovy plugins (or do we say Mojo?) for Maven 2.
> But I've never used them and don't know what they are capable of.
> I've found a link on Google on a mailing-list:
> http://mail-archives.apache.org/mod_mbox/cocoon-dev/200511.mbox/%3Cdls42k$pol$1@...%3E 
>
> But there might be other interesting pages.
> Please tell us what you discover on that topic!
>
> On 5/4/06, Tomas Hubalek <[hidden email]> wrote:
>> Hello all,
>>
>> I'm trying Maven 2 and I would like to compile Groovy scripts via
>> Maven 2.
>>
>> What is easiest way how to do it? In Maven 1 I did it in maven.xml, but
>> it not in Maven 2 any longer.
>>
>> If you have any idea or expirience  plase share it.
>>
>> Thanks a lot
>> Tom
>>
>> ---------------------------------------------------
>> Tomas Hubalek, http://blog.hubalek.net/
>>
>
>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Guillaume Laforge
Administrator
Thanks in advance!

On 5/4/06, Tomas Hubalek <[hidden email]> wrote:

> In case that I choice maven 2 and discover something I will post it to
> blog and/or to Groovy site...
>
> Have a nice day
> Tom
>
> ---------------------------------------------------
> Tomas Hubalek, http://blog.hubalek.net/
>
> Guillaume Laforge napsal(a):
> > Excellent question...
> > I've heard about Groovy plugins (or do we say Mojo?) for Maven 2.
> > But I've never used them and don't know what they are capable of.
> > I've found a link on Google on a mailing-list:
> > http://mail-archives.apache.org/mod_mbox/cocoon-dev/200511.mbox/%3Cdls42k$pol$1@...%3E
> >
> > But there might be other interesting pages.
> > Please tell us what you discover on that topic!
> >
> > On 5/4/06, Tomas Hubalek <[hidden email]> wrote:
> >> Hello all,
> >>
> >> I'm trying Maven 2 and I would like to compile Groovy scripts via
> >> Maven 2.
> >>
> >> What is easiest way how to do it? In Maven 1 I did it in maven.xml, but
> >> it not in Maven 2 any longer.
> >>
> >> If you have any idea or expirience  plase share it.
> >>
> >> Thanks a lot
> >> Tom
> >>
> >> ---------------------------------------------------
> >> Tomas Hubalek, http://blog.hubalek.net/
> >>
> >
> >
> > --
> > Guillaume Laforge
> > Groovy Project Manager
> > http://glaforge.free.fr/blog/groovy
> >
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Cliff-3
In reply to this post by Tomas Hubalek-3
Tom,

I've been down that road recently and have posted what I've learned so far on
this mailing list. Search the archives for "Bleeding Edge Experience" to see
what I wrote so far. I used the Ant plugin to run the compile but as others
have mentioned there are Groovy plugins that I haven't tried yet. I plan to
try them soon and post here what I find. I think there's also a way you can
configure the compiler plugin to use the Groovy compiler but I'm not sure.
Please do keep us informed on what you find as I will do the same. Post here
any specific questions and I'll try to help as I can.

---------------------------------------------------
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[hidden email]
[hidden email]

On Thursday 04 May 2006 8:47 am, Tomas Hubalek wrote:

> In case that I choice maven 2 and discover something I will post it to
> blog and/or to Groovy site...
>
> Have a nice day
> Tom
>
> ---------------------------------------------------
> Tomas Hubalek, http://blog.hubalek.net/
>
> Guillaume Laforge napsal(a):
> > Excellent question...
> > I've heard about Groovy plugins (or do we say Mojo?) for Maven 2.
> > But I've never used them and don't know what they are capable of.
> > I've found a link on Google on a mailing-list:
> > http://mail-archives.apache.org/mod_mbox/cocoon-dev/200511.mbox/%3Cdls42k
> >$pol$[hidden email]%3E
> >
> > But there might be other interesting pages.
> > Please tell us what you discover on that topic!
> >
> > On 5/4/06, Tomas Hubalek <[hidden email]> wrote:
> >> Hello all,
> >>
> >> I'm trying Maven 2 and I would like to compile Groovy scripts via
> >> Maven 2.
> >>
> >> What is easiest way how to do it? In Maven 1 I did it in maven.xml, but
> >> it not in Maven 2 any longer.
> >>
> >> If you have any idea or expirience  plase share it.
> >>
> >> Thanks a lot
> >> Tom
> >>
> >> ---------------------------------------------------
> >> Tomas Hubalek, http://blog.hubalek.net/
> >
> > --
> > Guillaume Laforge
> > Groovy Project Manager
> > http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Guillaume Laforge
Administrator
It makes me think all this research could be gathered on the wiki to
benefit everybody?

On 5/4/06, Clifton Craig <[hidden email]> wrote:

> Tom,
>
> I've been down that road recently and have posted what I've learned so far on
> this mailing list. Search the archives for "Bleeding Edge Experience" to see
> what I wrote so far. I used the Ant plugin to run the compile but as others
> have mentioned there are Groovy plugins that I haven't tried yet. I plan to
> try them soon and post here what I find. I think there's also a way you can
> configure the compiler plugin to use the Groovy compiler but I'm not sure.
> Please do keep us informed on what you find as I will do the same. Post here
> any specific questions and I'll try to help as I can.
>
> ---------------------------------------------------
> Clifton C. Craig, Software Engineer
> Intelligent Computer Systems -  A Division of GBG
> [hidden email]
> [hidden email]
>
> On Thursday 04 May 2006 8:47 am, Tomas Hubalek wrote:
> > In case that I choice maven 2 and discover something I will post it to
> > blog and/or to Groovy site...
> >
> > Have a nice day
> > Tom
> >
> > ---------------------------------------------------
> > Tomas Hubalek, http://blog.hubalek.net/
> >
> > Guillaume Laforge napsal(a):
> > > Excellent question...
> > > I've heard about Groovy plugins (or do we say Mojo?) for Maven 2.
> > > But I've never used them and don't know what they are capable of.
> > > I've found a link on Google on a mailing-list:
> > > http://mail-archives.apache.org/mod_mbox/cocoon-dev/200511.mbox/%3Cdls42k
> > >$pol$[hidden email]%3E
> > >
> > > But there might be other interesting pages.
> > > Please tell us what you discover on that topic!
> > >
> > > On 5/4/06, Tomas Hubalek <[hidden email]> wrote:
> > >> Hello all,
> > >>
> > >> I'm trying Maven 2 and I would like to compile Groovy scripts via
> > >> Maven 2.
> > >>
> > >> What is easiest way how to do it? In Maven 1 I did it in maven.xml, but
> > >> it not in Maven 2 any longer.
> > >>
> > >> If you have any idea or expirience  plase share it.
> > >>
> > >> Thanks a lot
> > >> Tom
> > >>
> > >> ---------------------------------------------------
> > >> Tomas Hubalek, http://blog.hubalek.net/
> > >
> > > --
> > > Guillaume Laforge
> > > Groovy Project Manager
> > > http://glaforge.free.fr/blog/groovy
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Cliff-3
On Thursday 04 May 2006 2:29 pm, Guillaume Laforge wrote:
> It makes me think all this research could be gathered on the wiki to
> benefit everybody?

That's true... I'll see what I can do.

---------------------------------------------------
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[hidden email]
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Cliff-3
In reply to this post by Guillaume Laforge
On Thursday 04 May 2006 2:29 pm, Guillaume Laforge wrote:
> It makes me think all this research could be gathered on the wiki to
> benefit everybody?

Done! Well I should say started. I started a page on the wiki which includes
an example of a project I built with Maven2. Nothing fancy here, I just use
the Ant plugin under M2 to compile a groovy src and test hierarchy. I'm just
getting used to Confluence as I've never used it before so the page may
appear a little sloppy. It's similar to SnipSnap wiki, which we use in house
here so I felt my way around a bit. The new page may not be in the right spot
either but I'm not comfortable enough with Confluence to go moving things
around. Feel free to add to, modify or move my content. There's a link to the
new page under the user guide in the section "Compiling with Ant/Maven".

---------------------------------------------------
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
[hidden email]
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Guillaume Laforge
Administrator
On 5/4/06, Clifton Craig <[hidden email]> wrote:
> Done! Well I should say started. I started a page on the wiki which includes
> an example of a project I built with Maven2. Nothing fancy here, I just use
> the Ant plugin under M2 to compile a groovy src and test hierarchy. I'm just
> getting used to Confluence as I've never used it before so the page may
> appear a little sloppy. It's similar to SnipSnap wiki, which we use in house
> here so I felt my way around a bit. The new page may not be in the right spot
> either but I'm not comfortable enough with Confluence to go moving things
> around. Feel free to add to, modify or move my content. There's a link to the
> new page under the user guide in the section "Compiling with Ant/Maven".

Thanks a lot for your contribution, it is very much appreciated!
And the link from the compiling page is perfect.
Well done!

And for the record, here is the link to the new page:
http://docs.codehaus.org/display/GROOVY/Compiling+Wih+Maven2

--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Groovy and Maven 2

Tomas Hubalek-3
Thank you very much, it helped me ... partially.  Now I know that I have
invoke it with mvn compile, but I have two problems with it:

First is with directory target/test-classes that is not created when I
do clean before compile. I guess that it may be problem of maven or
groovyc should be executed after javac (is it possible to set it in
antrun plugin?)

And second is probably based on maven2 transitive dependecies (as there
is NoSuchMethodError). BTW: I have mixed feeling from Maven2. It looks
much more complicated than Maven 1. :-| Has anybody better expirience?

Thanks Tom


Stacktrace generated:
[INFO] [antrun:run {execution: compile}]
[INFO] Executing tasks
  [groovyc] Compiling 1 source file to
/home/tom/Projects/ScrapMetric2/scrap-metric-webui/target/test-classes
  [groovyc]
/home/tom/Projects/ScrapMetric2/scrap-metric-webui/src/main/groovy/Test.groovy
[INFO]
----------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
----------------------------------------------------------------------------
[INFO]
org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
[INFO]
----------------------------------------------------------------------------
[INFO] Trace
java.lang.NoSuchMethodError:
org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
        at
org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:317)
        at
org.codehaus.groovy.control.CompilationUnit$7.call(CompilationUnit.java:690)
        at
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:956)
        at
org.codehaus.groovy.control.CompilationUnit.classgen(CompilationUnit.java:629)
        at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464)
        at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:421)
        at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:471)
        at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:376)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at
org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
        at
org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)



Guillaume Laforge napsal(a):

> On 5/4/06, Clifton Craig <[hidden email]> wrote:
>> Done! Well I should say started. I started a page on the wiki which
>> includes
>> an example of a project I built with Maven2. Nothing fancy here, I
>> just use
>> the Ant plugin under M2 to compile a groovy src and test hierarchy.
>> I'm just
>> getting used to Confluence as I've never used it before so the page may
>> appear a little sloppy. It's similar to SnipSnap wiki, which we use
>> in house
>> here so I felt my way around a bit. The new page may not be in the
>> right spot
>> either but I'm not comfortable enough with Confluence to go moving
>> things
>> around. Feel free to add to, modify or move my content. There's a
>> link to the
>> new page under the user guide in the section "Compiling with Ant/Maven".
>
> Thanks a lot for your contribution, it is very much appreciated!
> And the link from the compiling page is perfect.
> Well done!
>
> And for the record, here is the link to the new page:
> http://docs.codehaus.org/display/GROOVY/Compiling+Wih+Maven2
>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>

123
Loading...