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

HI,
I saw this warning while running my spring mvc application.
Although i resolved it by adding the following lines to my pom.xml file :
<properties>
		
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

Open in new window


Just wondering what are the consequences of this ? And is handling this warning important ?
what does it mean to to use platform encoding ?


Thanks
Rohit BajajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
Consequences of change you did are that next builds will be identical on any platform you use to build the project.
0
Rohit BajajAuthor Commented:
can it cause errors if i used platform dependent encoding and deployed the war on some other machine... i mean is there a practical way i can see this happening.
0
gheistCommented:
There is no problem. The problem would be if you compile on non-unicode platform and run on unicode platform and vice versa.
Now you added option that permits you to build on non-unicode platforms the unicode application, no code changed as consequence.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Just wondering what are the consequences of this ?
Maven goes to great lengths to try and ensure that as long as the actual source code/resources haven't changed, the build should be repeatable (ie. the result is exactly the same) no matter where you build it from. So the warning is just saying that "Hey, you may have an issue where a build on one system could turn out different than a build on another system, if the two systems have a different default encoding setting". The reason is before you added that property, it was left up to Maven to get the encoding from the default for the platform.

So what you have done is perfectly fine and correct. You are just saying that no matter where you build the application, always use UTF-8 as the encoding, ensuring that the result will be the same on any system.

And is handling this warning important ?
It is probably more for say library developers, where the code is distributed to whoever wants it (possibly hundreds, thousands, etc of people) and will be built on such a variety of machines. It just ensures that it is the same everywhere. For your case, where I guess you are just coding an application for your own or very limited distribution, you may only ever build on one type of platform and so you would always get the same result anyway. However, it probably is better to be safe than sorry, and so good to do it anyway.

what does it mean to to use platform encoding ?
Maybe that's obvious now from the above, but it just means the default encoding in use on the platform (ie. the system) that you are building the code on.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.