简体   繁体   中英

Compiling Groovy Code in my Java EE application

My web project includes Groovy class files. How should I compile it for my project using Eclipse? Rest of my team is using IntelliIDEA to use it but I want to set it up in Eclipse. To start with I have installed a Groovy Plug-In for my Eclipse and installed Groovy on my Windows.

You should be able to right click on the project -> Configure -> Convert to Groovy project.

If your project is a maven project, then you should also install m2eclipse as well as the optional m2eclipse configurator for groovy-eclipse. This will automatically configure your project for Eclipse and groovy.

Hope this links helps you. It has step by step on how to import your existing Groovy Project into eclipse so you can work on it.

http://docs.codehaus.org/display/GROOVY/Create+Your+First+Groovy+Project

If the project is created using grails create project , I believe all of the .project and .setting files are there for eclipse.

If you have the groovy eclipse plugin installed you should be able to mix your groovy classes into the same packages as your java code. Are you using maven or ant to build your actual war file? If not you will have to make sure that you compile the groovy classes along with the java code. while in eclipse you will be fine. Both ant and maven have facilities for compiling the groovy and java code together for your actual war that you deploy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM