Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More reliably detect own version #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vampire
Copy link
Contributor

@Vampire Vampire commented Sep 10, 2024

I modified a build and checked what changes happened to the generated SonarQube properties when using sonar.scanner.dumpToFile.
During this I stumbled upon sonar.scanner.appVersion being set to 0.60.3/Gradle 7.6.4 now.
The reasons is the very generically named and pathed /version.txt.
I now also have the https://github.com/Splitties/refreshVersions/ plugin in the classpath and it comes before this plugin.
That plugin happens to also have a version.txt file in the root of the classpath with its version inside.
This plugin then found that file and thus identified itself as version 0.60.3 wrongly.

This PR renames the version.txt file to a more unique name that is unlikely to clash with some other project
to more reliably detect the own version.

An alternative would be to put the file into a directory under the namespace of this plugin like org/sonarqube/gradle/version.txt.

@dorian-burihabwa-sonarsource
Copy link
Contributor

Hey @Vampire,
I created a ticket to track the issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants