1

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
  • Not in settings. Pleys put it in a company pom and inherit from there. Commented Dec 27, 2014 at 15:19

1 Answer 1

1

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>
Sign up to request clarification or add additional context in comments.

6 Comments

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?
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.
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?
@Albion See this link for how to use and activate profiles.
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.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.