1

In the JavaDoc, it's clearly defined how to set a property in SonarQube using org.sonar.api.config.PropertyDefinition in a plugin, however there is nothing on how to get it.

It seems to not work like System.getProperty(key) in Java, so, should I declare a new class that implements Configuration? Is there a way to reach these properties back properly?

Impulse The Fox
  • 2,638
  • 2
  • 27
  • 52
Waldo
  • 189
  • 1
  • 8

1 Answers1

1

You can get a Configuration object through a Context one or by injecting it through extension point constructor:

public MyExtensionPoint(Configuration config) { this.config = config; }

Use context.config() to get your Configuration object.

Then use configuration.get("key") to get the property.

begarco
  • 751
  • 7
  • 20