2017-08-31 50 views
0

我正在爲SonarQube創建一個插件並定義了一些屬性。我使用類型「屬性設置」如下:如何在sonarqube中設置聲納掃描器的屬性

PropertyDefinition.builder(PROJECT_SET) 
.index(1) 
.name("Project Definition") 
.description("Define the project(s) to gather data from") 
.type(PropertyType.PROPERTY_SET) 
.fields(
     PropertyFieldDefinition.build(PROJECT_URL) 
       .name("Project URL") 
       .description("Specify the project URL in the format: http(s)://<hostname>:<port>") 
       .type(PropertyType.STRING).build(), 
     PropertyFieldDefinition.build(PROJECT_NAME) 
       .name("Project Name") 
       .description("Specify the project name") 
       .type(PropertyType.STRING).build(), 
     PropertyFieldDefinition.build(PROJECT_QUERY) 
       .name("Project Search Query") 
       .description("Specify the search query to retrieve data from the project") 
       .type(PropertyType.STRING).build(), 
     PropertyFieldDefinition.build(PROJECT_VIEW) 
       .name("Project View") 
       .description("(OPTIONAL): Specify a view to apply to the query") 
       .type(PropertyType.STRING).build() 
) 
.category(MAIN_MENU) 
.onlyOnQualifiers(Qualifiers.PROJECT) 
.build() 

從項目網頁設置屬性時,也能正常工作,但我不能工作,如何從sonar-project.properties文件做到這一點。我從代碼中看到鑰匙出現爲:

PROJECT_SET.1.PROJECT_URL 

例如, myplugin.1.url = http://someurl:8080

但是,當我使用它不起作用。任何線索?

回答

0

解決,其相同的語法多模塊以便:

PROJECT_SET=1,2 
PROJECT_SET.1.PROJECT_URL=<url> 
PROJECT_SET.2.PROJECT_URL=<url> 
... 
相關問題