How to configure encoding in Maven?

0 votes

Hii team,

When I run maven install on my multi module maven project I always get the following output:

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

Configuring <encoding> for the maven-resources-plugin or the maven-compiler-plugin also doesn't fix it.

So what's the problem?

Jun 3 in Java by kartik
• 16,140 points
43 views

1 answer to this question.

0 votes

Hello @kartik,

I use some reporting plugins. In the documentation of the failsafe-maven-plugin (http://maven.apache.org/plugins/maven-failsafe-plugin/integration-test-mojo.html) I found, that the <encoding> configuration - of course - uses ${project.reporting.outputEncoding} by default. So I added the property as a child element of the project element and everything is fine now:

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

Hope it works!!

Thank you!

answered Jun 3 by Niroj
• 33,400 points

Related Questions In Java

0 votes
1 answer

How to set Encoding in Java ?

Unfortunately, the file.encoding property has to be specified as ...READ MORE

answered May 29, 2018 in Java by Rishabh
• 3,580 points
9,395 views
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,890 points
1,513 views
+1 vote
1 answer

How to tell the Maven to use the latest version of dependency in Java?

If you always want to use the ...READ MORE

answered Jun 26, 2018 in Java by Sushmita
• 6,890 points
5,955 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,420 points

edited Nov 6, 2018 by Omkar 24,677 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,060 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

How to run a .java file from command line passing arguments in Maven?

Hello @kartik, You could run: mvn exec:exec -Dexec.args="arg1". This will ...READ MORE

answered Jun 3 in Java by Niroj
• 33,400 points
165 views
0 votes
1 answer

how to do global variable declaration in java

Hello,​ Global varriable which is defined after the ...READ MORE

answered Apr 3 in Java by Niroj
• 33,400 points
49 views