I'm on windows a lot of the time and usually forget to do this so I'm constantly getting warnings about how my project encoding hasn't been set. Is there a way I can globally define this (maybe in settings.xml?) or not?
1 Answer
You can try setting the encoding property in a profile that is activated in the settings:
<settings>
[...]
<profiles>
<profile>
<id>inject-project-encoding</id>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>inject-project-encoding</activeProfile>
</activeProfiles>
</settings>
6 Comments
csh
Is it possible to only define an OS family for profile activation? Given that I only need this on Windows systems, or will I have to define each Windows OS I use?
khmarbaise
Don't do that. Best is to define such things in a company pom and inherit from there but not from settings. Cause everyone can have a different settings.xml on it's machine.
csh
All the computers belong to me and I keep the settings.xml synced across my computers because of things like sonatype deployment settings, does that change anything?
csh
I've looked at that. I asked if it was possible to ONLY define the OS family whereas Apache's examples define the entire OS.
|