December 14, 2012

OSX platform encoding in Maven

0  comments

By default Maven uses the operating system platform encoding for the build. On OSX this is MacRoman. This leads to warnings that the build is platform dependent:
$ mvn clean package
[INFO] Scanning for projects...


[WARNING] File encoding has not been set, using platform encoding MacRoman, 
i.e. build is platform dependent!


To fix this you just have to add the following profile to your ~/.m2/setting.xml:
		
		   utf8
		   
		     
		       UTF-8
		     
		     
		       UTF-8
		     
		   
		
The activate the utf8 profile with:
	
		utf8
	
When you successfully added the profile you get this fancy info message in your maven builds:
[INFO] Using 'UTF-8' encoding to copy filtered resources.

Tags

encoding, Mac OS X, MacRoman, maven, utf8


You may also like

Blog url changed to https

I just changed the url of this blog to https://jensjaeger.com. TLS encryption is now the default for all request to this page. It might be possible that some image links on some articles are hard coded http. If you find such an error it would be nice if you leave me comment so i can

Read More

Format date and time in java with prettytime

Prettytime is a nice java library to format a java Date()s in a nice humanized ago format, like: moments ago 2 minutes ago 13 hours ago 7 months ago 2 years ago Prettytime is localized in over 30 languages. It’s super simple to use Add the dependency to your maven pom: org.ocpsoft.prettytime prettytime 3.2.7.Final or

Read More