when you run mvn --version
part of the output includes the locale and pratform encoding. For example: Default locale: en_GB, platform encoding: Cp1252
I would like to know where it picks these up from and how they can be set
Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Maven tool is written in Java Language and used to build and manage projects written in C# (C Sharp), Ruby, Scala, and other languages. Developers can create a java-based project more easily with the use of Maven tool. To configure the Maven, you need to use Project Object Model, which is stored in a pom.
All Maven POMs inherit values from a parent POM. If a POM does not specify a direct parent using the parent element, that POM will inherit values from the Super POM. Project Inheritance shows the parent element of project-a which inherits the POM defined by the a-parent project.
"Maven" is really just a core framework for a collection of Maven Plugins. In other words, plugins are where much of the real action is performed, plugins are used to: create jar files, create war files, compile code, unit test code, create project documentation, and on and on.
maven picking these values from Java system properties. Here is how you could set encoding:
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties>
Or:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin>
Or pass parameter to maven command line:
mvn -Dproject.build.sourceEncoding=UTF-8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With