Apex Custom Plugin compatibility with SonarQube 25.3.0.104237

Hi Everyone,

I have a custom Apex Plugin which worked absolutely fine until Sonarqube 9.9. Recently, I upgraded to SonarQube 25.3.0.104237 community version and the plugin seems to be incompatible. When scanning .cls files using sonar cli, files are getting indexed but it is unable to analyse the class files. Also, rules from the custom plugin are available on SonarQube UI & even the quality profile is set correctly. Please suggest if any changes are required as I could not find any specific documentation related to this.
In sonar.properties file, inclusion for apex language and cls files is also present.

Below is my Apex.java class -

public class Apex extends AbstractLanguage {

    public static final String FILE_SUFFIXES_KEY = "sonar.apex.file.suffixes";
    public static final String[] DEFAULT_FILE_SUFFIXES = { ".cls", ".trigger" }; 
    public static final String NAME = "Apex";
    public static final String KEY = "apex";
    private final Configuration configuration;
    public Apex(Configuration configuration) {
        super(KEY, NAME);
        this.configuration = configuration;
    }
    /**
     * Returns an array with the key and name of the language. For example ["cls", "apex"].
     *
     * @return the array of the file suffixes.
     */
    @Override
    public String[] getFileSuffixes() {
        String[] suffixes = filterEmptyStrings(configuration.getStringArray(FILE_SUFFIXES_KEY));
        return suffixes.length == 0 ? DEFAULT_FILE_SUFFIXES : suffixes;
    }
}

Could somebody please help with this?

Hi,

It worked until 9.9? You mean you wrote it against some earlier version of SonarQube and it stopped working when you migrated to 9.9? And now you’re at 25.3?

At any rate, there were some significant API changes early in the 10-series (and presumably some in the 9-series as well, although I don’t remember back that far). The docs may help.

 
Ann

Yes the custom Apex plugin worked absolutely fine until SonarQube 9.9 and after that we directly updated to you 25.3 LTS version and now it has stopped working without any errors in the logs. As mentioned, rules from the plugin are all visible and loading correctly, just the scanning is not happening for .cls files. Let me know if you need any more inputs from me.
Looking forward for your help.

Hi,

As I said, there have been API changes. You should consult the docs I’ve linked.

 
HTH,
Ann

Hay Ann,

If APIs are deprecated, the scanner should show some errors in the logs, right?
There are no errors present. Hence, debugging is getting quite challenging.

Hi,

What version of SonarQube did you initially write the plugin against?

And have you tried enabling DEBUG logging?

 
Ann

It was initially written for 7.9 . With minor changes, we could use it till SonarQube 9.9 but looks like now it needs a major change wrt APIs. I am just wondering why these deprecated APIs are not giving errors , I have all the logs enabled.

Hi,

7.9 to 25.3 is a pretty big leap. I know there were significant API changes early in the 10-series. There were likely changes in the 8- and 9-serieses as well. At this point, I can only point you, again, to the change logs.

 
Ann