View Full Version : IDEA support, or workaround?
mystic
Jun 12th, 2009, 08:32 AM
Hi guys.
Great job with Roo. Very, very cool technology!
I really like IDEA a lot better then eclipse. I'm just use to it and like the conventions a lot more. Can I get some level of roo support to work with IDEA so I can develop a spring project with roo with idea? I don't mind having roo running in a separate command prompt... but the aspectj weaving isn't working :(
I tried the aspectj weaver that comes as a plugin to idea, but it will only weave pre-compiled aspects. I added them in the project settings, but it doesn't look that's working. I don't know much about aspectj other than working with it indirectly through spring. Also, idea's intellisense features are not working either with the added functionality through the aspects.
Help?
Also, is it hard to get roo to work with freemarker? I don't like jsp....
Again, great job on roo!
krimple
Jun 12th, 2009, 01:37 PM
I tried using IntelliJ Maia (I guess that's 9.0?) and it recognizes and lets you view .aj files. I have Maia downloaded to a different OS X application directory and don't mix my settings.
Good luck and enjoy. Looked good to me, plus it auto-refreshes the source code / build when you click back to it.
Ken
krimple
Jun 13th, 2009, 08:47 AM
I spoke too soon...
I realize now that the best IDE at the moment, one that fully supports the .aj files and AJDT, is SpringSource Tool Suite 2.1.0.M2. Configured to use Roo it will handle wiring in your actual controller class. Maia doesn't see the pre-compiled methods from the aspects.
So, if the code that accesses the .aj advised RooEntity object calls lives within .aj files, there will not be compiler errors. However, unless you edit the code within STS 2.1.0.M2 and configure roo support, you will not be able to compile access to advised code from within the IDE.
So, on STS this works:
@RooWebScaffold(automaticallyMaintainView = true, formBackingObject = Employee.class)
@RequestMapping("/employee/**")
@Controller
public class EmployeeController {
@ModelAttribute("departments")
public Collection<Department> populateDepartmentList() {
return Department.findAllDepartments();
}
}
However, on NetBeans 6.7 RC2, and IntelliJ Maia, I get a compiler error stating that it can't find findAllDepartments() in Department.
In all cases, maven properly compiles and runs the webapp in jetty or tomcat.
Anybody with other ideas? Am I missing a very simple setting on the IDE? I looked and didn't see any AJDT settings in Maia, only Spring / AspectJ support and it's already installed.
Thanks,
Ken
Ben Alex
Jun 16th, 2009, 07:42 AM
Sorry Ken, I'm not familiar with IDEA or NetBeans and their level of AspectJ support. One reason we used AspectJ for Roo was that AspectJ support already exists in most Java IDEs and any enhancements needed to that tooling would likely just involve adding code assist capabilities for ITDs. Because this enhancement would simply build on their existing AspectJ support and benefit not only Roo users but all AspectJ users, we felt AspectJ would probably be the most realistic prospect of Roo receiving widespread and deep tooling support within IDEs. The alternative would be to expect all IDEs to build Roo-specific tooling, which is comparably unrealistic and a lot more effort for them to do. I would recommend you ask your IDE provider about their plans regarding ITD support within their existing AspectJ plugins. Hopefully it's on the near-term roadmap.
In the meantime obviously STS 2.1.0.M2 and above represents a free, working alternative - and you can even use native Eclipse with standard AJDT and it will also offer you working code assist. The advantage of STS is you have an inbuilt Roo distribution that saves you having to separately download and install Roo, plus STS has a CTRL + R (or APPLE + R) key binding so you can issue Roo commands from any editor. It's not going to represent a major inconvenience to ALT TAB to a Roo shell and issue commands there manually, but it's still convenient to some people who don't want to bother loading Roo from the correct project directory. STS also lets you issue commands to run all integration tests within Eclipse, which is quite nice, and load the embedded web/app servers for Roo projects.
krimple
Jun 16th, 2009, 06:29 PM
Ben,
Thanks for the helpful response... I attempted to install the IntelliJ AspectJ plugin and set up aspect weaving. No joy, unfortunately. This was on Maia, the latest IntelliJ pre-release. Looks like if you're working with roo, your option is to develop within STS or eclipse as you mention as opposed to IntelliJ Idea and NetBeans.
FYI, I did some research and found that NetBeans does not have an active AspectJ project going (see http://aspectj-netbeans.sourceforge.net/) and the AspectJ project from IntelliJ doesn't seem to support the weaving of the .aj files using ITD (Inter Type Dependency) weaving you mention, at least as far as I can tell. I did try to detect and scan the .aj files, which it did, but then it didn't weave them properly.
I may post a question about that over on the IntelliJ forums or hit up the plugin developer on that. Maybe it's something I'm doing wrong.
Fine by me for now, as the AJDT plugin and the rest of what STS is giving me is a nice fit for experimenting with the platform. And you're right, the roo shell in the IDE is handy.
Ken
cherron2001
Dec 22nd, 2009, 10:00 AM
For any other IntelliJ fans who are keen to use Roo, I have created a feature request to add support for ITDs to JetBrain's existing AspectJ plugin. If you would like to see this happen, head over and add your vote:
http://youtrack.jetbrains.net/issue/IDEA-26959
Ben Alex
Dec 22nd, 2009, 05:49 PM
SpringSource has commented on the http://youtrack.jetbrains.net/issue/IDEA-26959 ticket and expressed our willingness to assist in delivering IntelliJ users proper ITD support. So please vote for IDEA-26959 if you'd like to see IntelliJ support.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.