NetBeans IDE 7.3: Groovy Meets Java EE

In NetBeans IDE 7.3, for the first time, when you create a new Groovy class in a web (i.e., Java EE) application, whether you're in an Ant project or Maven project, the IDE will set up everything for you automatically so that the Groovy class will be compiled together with the application.

For example, in the case of Maven, the Groovy dependency will be added to the POM and the Groovy Eclipse Compiler plugin will be registered there too. And, as you can see here, a special source package root is created for Groovy, automatically when you start creating your first Groovy class in a project:

Then when the application is built, so is the Groovy class:


Related reading, which shows more good stuff for Groovy fans in NetBeans IDE 7.3:

http://wiki.netbeans.org/NewAndNoteworthyNB73#Groovy

https://blogs.oracle.com/netbeansgroovy

Comments:

Is it possible to configure it so that it shows all sources together, too?

Posted by alex on January 23, 2013 at 02:55 AM PST #

Hi Alex, it's not possible at the moment (speaking about Maven projects - in Ant projects they are all together by default). This is because in Maven recommended project layout there are different folders for groovy and java files. But if you would be interested in such option I can do this for NB 8.0.

Posted by Martin on February 20, 2013 at 06:27 AM PST #

What about normal projects or Netbeans platform projects? I tried to add the 'groovy support' module to my netbeans module but i guess that was not it, since i can't even run a newly created groovy script file on it.

Posted by guest on April 13, 2013 at 10:21 AM PDT #

https://blogs.oracle.com/geertjan/entry/running_groovy_on_the_netbeans

Posted by Geertjan on April 13, 2013 at 04:04 PM PDT #

I wasn't able to hot-deploy Groovy classes for JavaEE application in NB 7.4
- Create new JavaEE Maven Application
- Add Groovy backing bean to simple JSF page
- Debug
- Change the groovy bean
No matter what, the Groovy bean won't update. Java
backing beans update just fine in the same application.

There seems to be no way to update Groovy bean besides re-running the app.

Can you confirm this?

Posted by Lenny Primak on February 02, 2014 at 03:31 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today