Search |
||
NetBeans 6 - my first 24 hoursPosted by michael_n on December 5, 2007 at 2:14 AM PST
My first 24 hours with NetBeans6.0 (final). I'm going to color a little outside the lines here, and soapbox a bit about "tools I use" (in NetBeans). Specifically: Spring 2.5, "vim", and Maven2. First impressions with Netbeans 6I had already been using & upgrading from NetBeans5.5, the 6.0 beta's, & the release candidates; and the first thing I noticed with NB6 is the startup speed is much improved over the previous rc2. On a (Linux) laptop, the NB rc2 was taking somewhere in the neighborhood of 10 seconds (not sure exactly, I get distracted while waiting... short attention span) and now it's thankfully down to a very focused 4 seconds. (update: ok, after adding in all those plugins I tend to use, this went back up. Memory makes a difference, too, of course. Startup time could be faster, though.). First tasks with a new toy: customization.
Btw, it's really nice being able to run the same software on completely disparate
platforms. Big things like this get lost in the little details once a technology
(like Java) becomes ubiquitous.
Ok, here's my setup. I'm getting pretty good at this, since I've been doing it a lot. I've been running NB on Linux, Windows & Mac. On Linux, just run the installer: chmod a+x, ./install, and the same GUI as on Windows & Mac guides you through the basic steps:
Time to install plugins.People rant or rave about the number of plugins for this IDE or that, but I've decided the perfect number of plugins per application is in fact 42. Strange, that is. But seriously: any more than that, they simply aren't used. Less, and I feel limited, the platform isn't extensible enough. (FireFox has been my strawman for this conclusion, but I've had the same experience in using other IDE's, too. Or, Maven, for that matter.)
Btw, I'd love a NB plugin like FEBE + CLEO for FireFox -- a way to backup & bundle all my
NB plugins into a single re-installable installer!
But here's the essential super-short list of optional / out-of-the box plugins:
To install any of these 3rd party plugins, manually download the respective ".nbm" file(s), and in NetBeans go to: Tools > Plugins, "Downloaded", "Add plugins..."
And that's just the built-in plugins: see also the 3rd party plugins at the plugin portal. My essential 3rd party plugins (for my particular needs) are:
Spring Framework 2.5If I may go on a tangent: the new Spring Framework 2.5 really, really simplifies your project configuration (compared to Spring 1.2 or even 2.0). I know this has very little to do with NetBeans per se, but it should be noted that there is nothing preventing you from using NetBeans for a Spring project (for example, you don't need the Spring IDE for a Spring project)-- quite to the contrary. And if you haven't browsed through the Spring 2.5 updates, you really should take a look; here's a quick launchpad:
First and foremost (test-first!), Spring2.5 supports JUnit4.4 annotation-style testcases. (Note: the abandoned gienah-testing project is no longer necessary to support this). As for the xml-style configuration (and, remember, it IS possible to have Java-style configuration (a la Guice)), the required XML has really been simplified. And with the NetBeans Spring plugin, you can (at the very least) use auto-completion in your bean configuration. In NetBeans, your Spring XML config shows up in a "Other Sources" folder in NetBeans, if using the standard Maven layout with a folder for properties and xml config in "{mymodule}/src/main/resources". As just an (incomplete) example, with Spring 2.5 you can configure a JMS sender and asynchronous JMS receiver all in POJO's, configuring the JMS broker URL & JMS 1.1 destination (topic/queue) in a easy-to-edit "properties" file (as another side-note, ActiveMQ is very Spring-friendly to configure. Very nice.) The below example shows the new 2.5 properties-configurator (it allows a java properties file to be read, substituting properties into your Spring xml config):
<!--
using the new (2.5) property-placeholder, eg, with properties
jms.url=tcp://hostname:61616 and topic jms.dest=FOO.TEST
-->
<context:property-placeholder location="classpath:jms-test.properties"/>
<!-- pojo listens for incoming jms messages (asynchronous) -->
<bean id="msgListener" class="com.company.jms.MsgListener"/>
<jms:listener-container connection-factory="myConnectionFactory">
<jms:listener destination="${jms.dest}" ref="jmsListener" method="processMessage"/>
</jms:listener-container>
<!-- a pooling based JMS provider -->
<bean id="jmsConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>${jms.url}</value>
</property>
</bean>
</property>
</bean>
Compare this to the old-style (Note: the xml below is just the property configurer -- which is just the first line in the above xml snippet):
<!-- old style (but it could be shorter) -->
<bean id="myPropertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>jms-test.properties</value>
</list>
</property>
</bean>
It is pretty simple to integrate ActiveMQ into your Maven2 projects' testcases (if you're already using Spring 2.x and Maven2). Note that you'll have to add the apache repository to your pom.xml (or settings.xml). More on plugins...Ok: back to Netbeans... Other plugins that are of interest (to me, anyway):
Any comments on other plugins? favorites? diamonds in the rough? plugins with potential? Open issuesOne thing that I haven't tried yet with the shiny new NB6 is the Profiler. But, on NB6.0-rc2, I couldn't get the Profiler to work with Maven2 projects as wonderfully as with Ant-based projects. With Ant, profiling a project is a breeze. With Maven... I couldn't really make it ... useful. I could attach to a running process, but still, things weren't quite "Just working". If I get it working (or if someone else has had a better experience), we can all share & share alike. As a workaround, I did a very Unix-only solution: you can pretty easily create a directory of symbolic links in Unix (with NetBeans, you can't create a Ant project and a Maven project in the same directory). For my Maven2 multi-project, I wrote a shell script that took all my Maven multi-module "src" directories & merged them into a single src tree in another directory; likewise, with my test source trees. Then, just have Netbeans create a new Ant project based in this new directory. Feel free to run the Profiler, Debugger, etc: any changes from the symbolically linked ant project are reflected (via the symlinks) in the original Maven project. (Cough, hack, hack.) But, I do have to note that the Profiler is really a useful tool -- another bonus in a very solid IDE. (And although I haven't mentioned it, none of the Netbeans 6 versions -- from the beta through to the release candidates -- ever crashed on me. On Windows, Linux, or Mac. I'm glad to say that this is becoming the expectation for software these days.) In short, so far, so good. -m »
Related Topics >>
Netbeans Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|