scala, maven, and netbeans

I've been coding scala using TextMate with ant or simple-build-tool, but I'd like to give NetBeans a try again. Coding without IDE wasn't as bad, since the compiler and tests can catch undefined symbols and typos while making code changes; however, that's not to say it was perfect. I had to go back and forth between the scaladoc and TextMate in situation I could have just let IDE autocompletion look things up. Also navigating between error messages and the code has been slow, especially since I moved to sbt, which is not integrated with TextMate.

At the same time, I don't want to add any ant scripts I worked so hard to get rid of. This means setting up maven build, which shouldn't be too bad since sbt already uses its dependency system and directory layout. I pretty much copied the pom.xml from scopt project, and fixed a few things, and got the maven working. Here's the pom.xml.

Then opened NetBeans 6.8 > File menu > Maven > Maven Project from Existing POM to create a NetBeans project. The problem was that the specs tests weren't sitting well with NetBeans. I remembered reading about wrapping the specs with JUnit, so I replaced Specification with SpecificationWithJUnit and then the test cases showed up in the IDE.

Next problem was that the test project was picking up *.scala from test/resources. I figured this is due to difference between my setup and maven's default directory for test sources, so I added the following under <build>:

<sourceDirectory>${project.basedir}/src/main/scala</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/scala</testSourceDirectory>

and that solved the problem, I think.

I then had more subjective (yet important) problem of colors. I've been staring at TextMate's Twilight for so long, I found the NetBean's default theme to be too much for the eyes. I switched to Twilight theme, and fixed some settings up, and it looks much better.