title: Maven build error on MAcOS : " unmappable character for encoding UTF-8"
body: <p>I working on MacOs on Eclipse Kepler.</p>
  
  <p>I'm trying to run maven with UTF8 to be OS dependent.</p>
  
  <p>I think I have tried a lot of solutions that seems to work for others not for me.</p>
  
  <pre><code>export JAVA _TOOL_OPTIONS -Dfile.encoding=UTF-8
  </code></pre>
  
  <p>When i Run in console : </p>
  
  <pre><code>mvn -version
  
  
  Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
  Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
  Maven home: /usr/share/maven
  Java version: 1.6.0_45, vendor: Apple Inc.
  Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
  Default locale: fr_FR, platform encoding: UTF-8
  OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>But i am running maven via Eclipse and Eclipse says platform encoding macRoman...
  When i run a </p>
  
  <blockquote>
    <p>clean install</p>
  </blockquote>
  
  <pre><code>Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
  Maven home: /Users/JP/git/CleanOmicsTracer/EMBEDDED
  Java version: 1.6.0_45, vendor: Apple Inc.
  Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
  Default locale: fr_FR, platform encoding: MacRoman
  OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>In my pom.xml i have setted as this to set UTF-8:</p>
  
  <pre><code>     &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
       &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
       &lt;project.resources.sourceEncoding&gt;UTF-8&lt;/project.resources.sourceEncoding&gt;
  
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
          &lt;configuration&gt;
              &lt;tag&gt;${project.build.finalName}&lt;/tag&gt;
              &lt;url&gt;http://localhost:8080/manager/text&lt;/url&gt;
              &lt;server&gt;localhost&lt;/server&gt;
              &lt;charset&gt;UTF-8&lt;/charset&gt;
              &lt;update&gt;true&lt;/update&gt;
              &lt;path&gt;/${project.build.finalName}&lt;/path&gt;
              &lt;username&gt;jp&lt;/username&gt;
              &lt;password&gt;camille&lt;/password&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  
       &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
          &lt;configuration&gt;
          &lt;source&gt;${jdk.version}&lt;/source&gt;
          &lt;target&gt;${jdk.version}&lt;/target&gt;
          &lt;encoding&gt;${project.build.sourceEncoding}&lt;/encoding&gt;
          &lt;sourceEncoding&gt;${project.build.sourceEncoding}&lt;/sourceEncoding&gt;
  
          &lt;fork&gt;true&lt;/fork&gt;
              &lt;meminitial&gt;128m&lt;/meminitial&gt;
               &lt;maxmem&gt;1024m&lt;/maxmem&gt;
              &lt;url&gt;http://localhost:8080/manager/text&lt;/url&gt;
              &lt;server&gt;localhost&lt;/server&gt;
              &lt;path&gt;/${project.build.finalName}&lt;/path&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  
  
       &lt;plugin&gt;
       &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
       &lt;version&gt;2.6&lt;/version&gt;
       &lt;configuration&gt;
       &lt;encoding&gt;${project.build.sourceEncoding}&lt;/encoding&gt;
       &lt;sourceEncoding&gt;${project.build.sourceEncoding}&lt;/sourceEncoding&gt;
       &lt;/configuration&gt;
       &lt;/plugin&gt;
  </code></pre>
  
  <p>It's not working, the é and è in my .java create an error :</p>
  
  <p>When i change in maven-compile-plugin this line </p>
  
  <blockquote>
    <p>macRoman</p>
  </blockquote>
  
  <p>, it will be ok but no more Os Dependent and characters will be misunderstood in my other computer in linux.</p>
  
  <p>When i clean install, the ouput is ok for ressources but nothing is done for the compiler :</p>
  
  <blockquote>
    <p>[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @
    CleanOmicsTracer --- [INFO] Using 'UTF-8' encoding to copy filtered
    resources. [INFO] Copying 36 resources [INFO]</p>
    
    <p>[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @
    CleanOmicsTracer --- [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 142 source files to
    /Users/JP/git/CleanOmicsTracer/target/classes [INFO]</p>
    
    <p>[INFO] --- maven-resources-plugin:2.6:testResources
    (default-testResources) @ CleanOmicsTracer --- [INFO] Using 'UTF-8'
    encoding to copy filtered resources. [INFO] skip non existing
    resourceDirectory /Users/JP/git/CleanOmicsTracer/src/test/resources</p>
  </blockquote>
  
  <p><strong>UPDATE :</strong> I change eclipse configuration to use /usr/share/maven and not the embeded version.
  I still have errors whereas this time the platform encoding is well set to UFT-8:</p>
  
  <pre><code>Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
  Maven home: /usr/share/java/maven-3.0.4
  Java version: 1.6.0_45, vendor: Apple Inc.
  Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
  Default locale: fr_FR, platform encoding: UTF-8
  OS name: "mac os x", version: "10.8.4", arch: "x86_64", family: "mac"
  
  [ERROR] /com/clb/genomic/lyon/validator/ParticipantExistenceValidator.java:[101,93] unmappable character for encoding UTF-8
  [ERROR] -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: 
  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project CleanOmicsTracer: Compilation failure
  </code></pre>