Posts

Showing posts from October, 2013

Intellij change default encoding for properties and message bundle files to utf-8

Image
By default IntelliJ IDEA encodes Properties and Message bundle files using the System's default encoding (e.g. ISO-8859-1)

In my experience this is problematic since most frameworks out there use UTF-8 and most of the time you work in multi-platform environments.

If you are not careful and start writing say your i18n files with the default setting you'll be in hell when you realize that you have to save your files in UTF-8 for your favorite framework all your Properties files will probably become corrupt during the file-encoding conversion process.

This setting can be change either on the project level (this will affect only the current project) or on the IDE level (this will affect all new projects)

To change this setting on the IDE level just follow these easy steps :

File --> Other Settings --> Default Settings --> File Encodings Change the value of Default encoding for properties file to UTF-8 (or another one of your choice)
Now the default encoding for all y…

Intellij scala and SBT dependencies - enhancing the development experience

Image
I'm the happy owner of an Intellij Idea licence which I love, and as stated on a recent article I started learning Scala not long ago and I'm having some trouble to feel the SBT loveWhile playing a bit with Scala/SBT and IntelliJ I realized that the support for it is not great there are a few plugins bundled such as the SBT executor which adds some functionality, but no syntax highlighting for the .sbt files and more importantly no dependency management inside the IDE which for me is a deal breaker (Albeit since I'm pretty new to the Scala world I might be doing it wrong...)Luckily a few day ago I found this sbt plugin nightly builds which is a new IntelliJ plugin that will add some sugar to your Scala/SBT development such as dependency management.You will find all the installation instructions in the link above as well as information on the plugin features Now as stated on the website this plugin is still Alpha so there are still some rough edges and quircks. I for exampl…

Maven build number, versioning your projects builds automatically

By default all maven projects have a version number that you increase upon releases whether it's a minor or major release. When you are in a scenario in which you continuously deliver application (for example on a staging server) it's probably a good idea to have some unique build identifier so as to know the exact version that is deployed on the serverLuckily the guys over at codehaus have an app plugin just for that . I'm talking about the buildnumber-maven-plugin This plugins will generate a build identifier each time you compile your maven project and make this identifier available through a maven variable ${buildNumber}The plugin can generate build numbers in 3 ways : SCM (my personal favorite)Sequential build numberTimestampPersonally I prefer the SCM approach since it's coupled with your commits, and I will here I will be showing how to do that First you will have to configure the maven scm plugin with your details, otherwise you'll end up with error message…

Maven filtering test resources

When running tests in maven it's common usage to have configuration files that should be filtered.When filtering "normal" resources the syntax is the following : ... ${project.basedir}/src/main/resourcestrue ... Whereas when filtering test resources the syntax is following : ... ${project.basedir}/src/test/resourcestrue ... Otherwise your test resources will not be filtered

Scala sbt and np plugin type error in expression

I started learning scala a month or so ago, and I must say SBT is a bit of a pain to use to me ( Maven I miss you!!). I know you can use Maven to build your scala projects instead of SBT but I was trying to do it the "scala" way While trying to get started with a simple Hello World and I was having some issues while getting started using SBTWhen using SBT apparently it's a defacto standard to use the sbt np plugin to create a scala project skeleton. But after following the instructions on how to set-up SBT and the NP plugin I stumbled upon the following error when running sbt np: /home/ufasoli/.sbt/0.13/_settings.sbt:1: error: not found: value npSettings seq(npSettings:_*) ^ [error] Type error in expression From what I could read there were changes introduced in the sbt version 0.13 that changed the way plugins are configured. SBT's global configuration is now versioned which, from my understading means than instead of putting your global config files under …