final NewIssue newIssue = sensorContext.newIssue().forRule(ruleKey);
NewIssueLocation mainLocation = ...
newIssue.at(mainLocation);
NewIssueLocation secondLocation = ...
newIssue.addLocation(location);
newIssue.save();
mainLocation is on json file: fr.json,
secondLocation is on json file: en.json
fr.json is published to sonarqube server, but en.json isn’t.
I tried in both sonarqube 8.9 and sonarqube 9.9, the result is same.
Google told me: you don't need to do anything special to push secondary locations to the SonarQube server. They will be pushed automatically when you submit the analysis., but its evident it is wrong.
=================
I found a workaround way: The API: org.sonar.api.batch.fs.internal.DefaultInputFile#setPublished could declare en.json published. But the API belong to org.sonarsource.sonarqube:sonar-plugin-api-impl.
So my question is: can I use org.sonarsource.sonarqube:sonar-plugin-api-impl as development dependencies, like following (in many examples, its scope is just test)?
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api-impl</artifactId>
<version>${sonar.version}</version>
<scope>provided</scope>
</dependency>
If not, how can I make en.json published?