Where are located SensorContextTester and TestInputFileBuilder?

Hi,

I’m updating a custom language plugin for SonarQube to be compatible with SonarQube 2026.1 LTA and Community.

I have a test for the custom plugin which uses

  • SensorContextTester class which was available for the SQ 2025 LTA under sonar-plugin-api-impl artifact and imported using org.sonar.api.batch.sensor.internal.SensorContextTester class path.
  • TestInputFileBuilder class was available for the SQ 2025 LTA under sonar-plugin-api-impl artifact and imported using org.sonar.api.batch.sensor.internal.SensorContextTester class path.

Have these been relocated somewhere else or removed ? If removed, have you something else to replace them ?

Should I add a specific dependency in pom.xml to be able to find them? Actually I’m using only

        <dependency>
            <groupId>org.sonarsource.api.plugin</groupId>
            <artifactId>sonar-plugin-api</artifactId>
            <version>13.4.2.4284</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.sonarsource.api.plugin</groupId>
            <artifactId>sonar-plugin-api-test-fixtures</artifactId>
            <version>13.4.2.4284</version>
            <scope>test</scope>
        </dependency>

and removed the dependency on sonar-plugin-api-impl.

Thanks in advance for your feedback.

Best regards

Monika

Hi @MonikaK

SensorContextTester and TestInputFileBuilder did not move recently, and are still located in sonar-plugin-api-impl.
I’m not sure if I understood correctly, but If you removed the dependency to sonar-plugin-api-impl, it’s expected you will not find them anymore.

EDIT: In case it may help I was able to find the classes here in Maven

Thanks for your feedback.

I was able to figure this out by adding back sonar-plugin-api-impl in the pom.xml

However, since sonar-plugin-api-impl 26.7.0.124771, org.sonar.api.batch.fs.internal.* are removed, how to migrate to sonar-plugin-api-impl 26.11.0.134175? thanks

Heading

Hello @ct24p,

Thanks for reaching out.

These classes have been moved to the org.sonar.scanner.plugin.api.impl.fs.* package in the org.sonarsource.scanner.engine:plugin-api-scanner-impl package (note the different group ID). The org.sonar.api.batch.sensor.internal.* package has been moved to com.sonarsource.scanner.engine.sensor.test.fixtures in the org.sonarsource.scanner.engine:sensor-test-fixtures package. This has been done as part of a deduplication effort between our different products.

Unfortunately, these packages are versioned differently. See the “Scanner Engine” column in the tables in the sonar-plugin-api repository for which version to use. For 26.11.0.134175, it would be 13.16.0.6705.

Sorry for the inconvenience this has caused.

Best,
Sebastian Zumbrunn