Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3158

ISO-8859-1 file results in: Can not execute Sonar: Unable to read and import the source file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.12
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      Dear Maintainer,

      I execute target
      mvn sonar:sonar
      and receive an error.

      [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project descore: Can not execute Sonar: Unable to read and import the source file : '/home/user/workspace/descore/trunk/src/test/java/de/xypron/simulation/file/package-info.java' with the charset : 'ISO-8859-1'. de.xypron.simulation.file.package-info -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project descore: Can not execute Sonar
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)

      The file exists and it conforms to encoding ISO-8859-1 (see appendix).

      I tested this with the followin Java program, which had no problem in reading the file:

      import java.io.File;
      import java.io.IOException;
      import org.apache.commons.io.FileUtils;

      public class App {

      public static void main(String[] args) {
      File file;
      file = new File("/home/user/workspace/descore/trunk/src/test/java/de/xypron/simulation/file/package-info.java");
      try

      { String source = FileUtils.readFileToString(file, "ISO-8859-1"); System.out.println(source); }

      catch (IOException e)

      { e.printStackTrace(); }

      }
      }

      Best regards

      Xypron

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            xypron Heinrich Schuchardt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: