Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make maven build platform independent?

Tags:

linux

maven

When building using Maven on my mac, on mvn install i get

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

Is it possible to either build for a given platform (Linux) or otherwise make build platform independent?

like image 488
James Raitsev Avatar asked Apr 26 '12 14:04

James Raitsev


People also ask

Is Maven platform dependent?

[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 project.

What is Maven platform?

Maven is a comprehensive solution that provides full technology and business services for brand partners. Our stand-alone, SAAS model drives value for partners through unique offerings that deliver instant cost savings, revenue expansion and audience growth.

How do you get Pom properties at runtime?

Use the properties-maven-plugin to write specific pom properties to a file at compile time, and then read that file at run time.

How You Can Produce execution debug output or error messages?

How to produce execution debug output or error messages? You could call Maven with -X parameter or -e parameter. For more information, run: mvn --help.


2 Answers

It happens when you have not provided following in your pom.xml

<properties>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> 

Absence of this means you are using platform specific encoding and that's why the warning.

like image 181
Kalpak Gadre Avatar answered Sep 22 '22 17:09

Kalpak Gadre


And if @Kal's answer doesn't work for you, perhaps you can learn from my last 30 minutes... below link adds an additional line to the above answer and solved my problem. My problem was related to the maven-resources-plugin 2.6, but the provider of the following solution had a different problem it solved... https://stackoverflow.com/a/3018152/2485075

like image 42
Mike Avatar answered Sep 25 '22 17:09

Mike