Today I’ll write a post a little differently than usual. I won’t write about code per say but about my experience with IntelliJ IDEA. Some of you might be aware that one of our developers has developed an IDEA plugin for Nuxeo, so I decided to give it a try.
First thing I did was import Nuxeo Platform source code using maven. All I had to do was tell IDEA where the root pom and the addon parent pom were. As you know we have many modules so I was expecting this step to take forever. I’m happy to say I was wrong. It went really fast. And I didn’t have to specify my maven repo as an environment variable. What surprised me though is that there is no default JDK, hence there are errors everywher – something fixed quickly using the contextual help. Anyway, it feels great just to navigate in the code. It feels a lot more responsive than the last version of Eclipse, for instance. So, I might seriously consider to switch just on that feeling.
About the Nuxeo plugin: It’s available on the official repository so it’s really easy to install. To configure it, the first thing to do is add the Nuxeo SDK under Settings/Nuxeo/Nuxeo SDKs
Then go back to the main Nuxeo menu and select the newly added SDK. For the hot reload to work, you need to add the sdk template to nuxeo.conf. Simply click on configure; it will add the template for you. The hot reload will then work because the default tomcat valve will be replaced by the one from the template. You’ll find more details on a previous post.
Now if you hit CTRL+ALT+R, it will trigger hot reload of the bundles having the Nuxeo facet. To test this, I’ve created a very simple bundle with a Listener that logs “Bundle reloaded” each time an event occurs in Nuxeo. To add the facet to that module, go in the project structure, find the module you want to hot reload, right click on it and you should be able to add the Nuxeo facet. Then don’t forget to tick the ‘enable hot reload’ box.
The other cool feature coming with this plugin is the Nuxeo Shell, made available from within IDEA. It allows you to connect to any Nuxeo instance and run scripts or automation chain.
Anyway, as you can see, the IntelliJ IDEA plugin for Nuxeo lacks some features compared to the Eclipse plugin. I might try to add the SDK in the classpath for Nuxeo module as well as the automatic maven dependency management from the SDK in the coming days. Keep in mind that it’s currently not officially maintained by Nuxeo, but feel free to ask questions on Nuxeo Answers or even to contribute to the project :)
Let us know what you think about IntelliJ IDEA or about your choice of IDE while coding with Nuxeo. Come have a chat with us on our Google community page.