SonarQube
  1. SonarQube
  2. SONAR-2444

DuplicatedSourceException when using package-info.java file in source package and test package of same name

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 3.3
    • Component/s: Batch Analysis, Unit Test
    • Labels:
      None
    • Environment:
      Linux, Java 6, Maven 2
    • Number of attachments :
      1

      Description

      In our Java project, we have in src/main/java a package x.y.z that contains a file 'package-info.java' for Java doc purposes.
      There's also a package x.y.z (i.e. of same name) in src/test/java which contains the related tests. There's also a file 'package-info.java' there.

      After doing a 'mvn clean install', running 'mvn sonar:sonar' with version 2.4.1 of the Sonar Maven Plugin worked fine for this project.
      However, we have upgraded to version 2.7, and now we get

      org.sonar.api.resources.DuplicatedSourceException: x.y.z.package-info
      at org.sonar.batch.index.SourcePersister.saveSource(SourcePersister.java:45)

      (see attachment for full stacktrace) on 'mvn sonar:sonar' when the 'Sensor JavaSourceImporter' runs.

      Where's the problem here?

        Issue Links

          Activity

            People

            • Assignee:
              David Gageot
              Reporter:
              Matthias Paul Scholz
            • Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: