Thomas Sundberg

February 22, 2011

Build is platform dependent

Filed under: Java, Maven — Tags: , , , , — Thomas Sundberg @ 22:44

This post has been migrated to

Chasing the warning:

[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!

happens too often when you use Maven as a build tool. It is so frequent that it has made it to Maven Official FAQ how you fix it. The simple solution is to add the property and set it to the file encoding you want. This often tends to be UTF-8 for me.

It is very annoying when you have set the file encoding using the property and run the build again and notice the warning below:

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

Didn’t I just fix that warning? It turns out that this is another warning about the same thing. It is generated by some plugins, in this case by the maven-failsafe-plugin. How can this warning be removed? Simple, just set the file encoding you want for the reports by using the property project.reporting.outputEncoding.

A working pom could look like this:

<?xml version="1.0" encoding="UTF-8"?>



  1. Thanks, good tip

    Comment by Steve — July 20, 2011 @ 01:58

  2. Worked for me, Thanks

    Comment by Eccentric.Ash — July 21, 2011 @ 00:19

  3. Using it now… thanks a lot!

    Comment by Cristian — January 6, 2012 @ 04:03

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: