diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-27 13:37:37 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-28 09:29:04 +0200 |
commit | 92f01954fc68bcbe8004b1e8433a469ca67118e7 (patch) | |
tree | 0057dbeb9e0bd3f34c81bc862ddba056fd39731b | |
parent | 9c1417ee34fcf0f4da7553baa6f9d6a1657d7157 (diff) | |
download | sonarqube-92f01954fc68bcbe8004b1e8433a469ca67118e7.tar.gz sonarqube-92f01954fc68bcbe8004b1e8433a469ca67118e7.zip |
SONAR-6370 move properties out of core plugin
3 files changed, 124 insertions, 229 deletions
diff --git a/plugins/sonar-core-plugin/pom.xml b/plugins/sonar-core-plugin/pom.xml index 58ead2cf637..770bdb4ed90 100644 --- a/plugins/sonar-core-plugin/pom.xml +++ b/plugins/sonar-core-plugin/pom.xml @@ -14,78 +14,15 @@ <dependencies> <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.codehaus.sonar</groupId> <artifactId>sonar-plugin-api</artifactId> <scope>provided</scope> </dependency> <dependency> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-core</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>jfree</groupId> - <artifactId>jfreechart</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-plugin-api</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> + <groupId>com.google.code.findbugs</groupId> + <artifactId>jsr305</artifactId> <scope>provided</scope> </dependency> - - <!-- unit tests --> - <dependency> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-core</artifactId> - <version>${project.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <!-- local database --> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-testing-harness</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-plugin-api</artifactId> - <type>test-jar</type> - <scope>test</scope> - <version>${project.version}</version> - </dependency> </dependencies> <build> diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java index 289cb0a9ccd..ceb5531722f 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java @@ -21,172 +21,10 @@ package org.sonar.plugins.core; import java.util.Collections; import java.util.List; -import org.sonar.api.CoreProperties; -import org.sonar.api.Properties; -import org.sonar.api.Property; -import org.sonar.api.PropertyType; import org.sonar.api.SonarPlugin; -@Properties({ - @Property( - key = CoreProperties.SERVER_BASE_URL, - defaultValue = CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE, - name = "Server base URL", - description = "HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.", - project = false, - global = true, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.LINKS_HOME_PAGE, - defaultValue = "", - name = "Project Home Page", - description = "HTTP URL of the home page of the project.", - project = false, - global = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.LINKS_CI, - defaultValue = "", - name = "CI server", - description = "HTTP URL of the continuous integration server.", - project = false, - global = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.LINKS_ISSUE_TRACKER, - defaultValue = "", - name = "Issue Tracker", - description = "HTTP URL of the issue tracker.", - project = false, - global = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.LINKS_SOURCES, - defaultValue = "", - name = "SCM server", - description = "HTTP URL of the server which hosts the sources of the project.", - project = false, - global = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.LINKS_SOURCES_DEV, - defaultValue = "", - name = "SCM connection for developers", - description = "HTTP URL used by developers to connect to the SCM server for the project.", - project = false, - global = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.ANALYSIS_MODE, - defaultValue = CoreProperties.ANALYSIS_MODE_ANALYSIS, - name = "Analysis mode", - type = PropertyType.SINGLE_SELECT_LIST, - options = {CoreProperties.ANALYSIS_MODE_ANALYSIS, CoreProperties.ANALYSIS_MODE_PREVIEW, CoreProperties.ANALYSIS_MODE_INCREMENTAL}, - global = false, project = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.PREVIEW_INCLUDE_PLUGINS, - deprecatedKey = CoreProperties.DRY_RUN_INCLUDE_PLUGINS, - name = "Plugins accepted for Preview and Incremental modes", - description = "Comma-separated list of plugin keys. Those plugins will be used during preview or incremental analyses.", - defaultValue = CoreProperties.PREVIEW_INCLUDE_PLUGINS_DEFAULT_VALUE, - global = true, project = false, - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.PREVIEW_EXCLUDE_PLUGINS, - deprecatedKey = CoreProperties.DRY_RUN_EXCLUDE_PLUGINS, - name = "Plugins excluded for Preview and Incremental modes", - description = "Comma-separated list of plugin keys. Those plugins will not be used during preview or incremental analyses.", - global = true, project = false, - defaultValue = CoreProperties.PREVIEW_EXCLUDE_PLUGINS_DEFAULT_VALUE, - category = CoreProperties.CATEGORY_GENERAL), - - // SERVER-SIDE TECHNICAL PROPERTIES - - @Property( - key = CoreProperties.CORE_AUTHENTICATOR_REALM, - name = "Security Realm", - project = false, - global = false - ), - @Property( - key = "sonar.security.savePassword", - name = "Save external password", - project = false, - global = false - ), - @Property( - key = "sonar.authenticator.downcase", - name = "Downcase login", - description = "Downcase login during user authentication, typically for Active Directory", - project = false, - global = false, - defaultValue = "false", - type = PropertyType.BOOLEAN), - @Property( - key = CoreProperties.CORE_AUTHENTICATOR_CREATE_USERS, - name = "Create user accounts", - description = "Create accounts when authenticating users via an external system", - project = false, - global = false, - defaultValue = "true", - type = PropertyType.BOOLEAN), - @Property( - key = CoreProperties.CORE_AUTHENTICATOR_UPDATE_USER_ATTRIBUTES, - name = "Update user attributes", - description = "When using the LDAP or OpenID plugin, at each login, the user attributes (name, email, ...) are re-synchronized", - project = false, - global = false, - defaultValue = "true", - type = PropertyType.BOOLEAN), - @Property( - key = CoreProperties.CORE_AUTHENTICATOR_IGNORE_STARTUP_FAILURE, - name = "Ignore failures during authenticator startup", - defaultValue = "false", - project = false, - global = false, - type = PropertyType.BOOLEAN), - @Property( - key = "sonar.enableFileVariation", - name = "Enable file variation", - global = false, - defaultValue = "false", - category = CoreProperties.CATEGORY_GENERAL), - @Property( - key = CoreProperties.CORE_AUTHENTICATOR_LOCAL_USERS, - name = "Local/technical users", - description = "Comma separated list of user logins that will always be authenticated using SonarQube database. " - + "When using the LDAP plugin, for these accounts, the user attributes (name, email, ...) are not re-synchronized", - project = false, - global = false, - defaultValue = "admin", - type = PropertyType.STRING, - multiValues = true), - @Property( - key = CoreProperties.SCM_DISABLED_KEY, - defaultValue = "false", - name = "Disable the SCM Sensor", - description = "Disable the retrieval of blame information from Source Control Manager", - module = false, - project = true, - global = true, - category = CoreProperties.CATEGORY_SCM, - type = PropertyType.BOOLEAN - ), - @Property( - key = CoreProperties.SCM_PROVIDER_KEY, - defaultValue = "", - name = "Key of the SCM provider for this project", - description = "Force the provider to be used to get SCM information for this project. By default auto-detection is done. Example: svn, git.", - module = false, - project = true, - global = false, - category = CoreProperties.CATEGORY_SCM - ) -}) public final class CorePlugin extends SonarPlugin { - @SuppressWarnings("rawtypes") @Override public List getExtensions() { return Collections.emptyList(); diff --git a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java index 8a19cd775c7..c392960f020 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java +++ b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java @@ -21,14 +21,14 @@ package org.sonar.core.config; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.List; import org.sonar.api.CoreProperties; import org.sonar.api.PropertyType; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.resources.Qualifiers; import org.sonar.core.computation.dbcleaner.DataCleanerProperties; -import java.util.List; - public class CorePropertyDefinitions { private CorePropertyDefinitions() { @@ -44,6 +44,126 @@ public class CorePropertyDefinitions { defs.addAll(DataCleanerProperties.all()); defs.addAll(ImmutableList.of( + PropertyDefinition.builder(CoreProperties.SERVER_BASE_URL) + .name("Server base URL") + .description("HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.") + .category(CoreProperties.CATEGORY_GENERAL) + .defaultValue(CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE) + .build(), + + PropertyDefinition.builder(CoreProperties.LINKS_HOME_PAGE) + .name("Project Home Page") + .description("HTTP URL of the home page of the project.") + .hidden() + .build(), + PropertyDefinition.builder(CoreProperties.LINKS_CI) + .name("CI server") + .description("HTTP URL of the continuous integration server.") + .category(CoreProperties.CATEGORY_GENERAL) + .build(), + PropertyDefinition.builder(CoreProperties.LINKS_ISSUE_TRACKER) + .name("Issue Tracker") + .description("HTTP URL of the issue tracker.") + .category(CoreProperties.CATEGORY_GENERAL) + .hidden() + .build(), + PropertyDefinition.builder(CoreProperties.LINKS_SOURCES) + .name("SCM server") + .description("HTTP URL of the server which hosts the sources of the project.") + .category(CoreProperties.CATEGORY_GENERAL) + .build(), + PropertyDefinition.builder(CoreProperties.LINKS_SOURCES_DEV) + .name("SCM connection for developers") + .description("HTTP URL used by developers to connect to the SCM server for the project.") + .category(CoreProperties.CATEGORY_GENERAL) + .hidden() + .build(), + PropertyDefinition.builder(CoreProperties.ANALYSIS_MODE) + .name("Analysis mode") + .type(PropertyType.SINGLE_SELECT_LIST) + .options(Arrays.asList(CoreProperties.ANALYSIS_MODE_ANALYSIS, CoreProperties.ANALYSIS_MODE_PREVIEW, CoreProperties.ANALYSIS_MODE_INCREMENTAL)) + .category(CoreProperties.CATEGORY_GENERAL) + .defaultValue(CoreProperties.ANALYSIS_MODE_ANALYSIS) + .hidden() + .build(), + PropertyDefinition.builder(CoreProperties.PREVIEW_INCLUDE_PLUGINS) + .deprecatedKey(CoreProperties.DRY_RUN_INCLUDE_PLUGINS) + .name("Plugins accepted for Preview and Incremental modes") + .description("Comma-separated list of plugin keys. Those plugins will be used during preview or incremental analyses.") + .category(CoreProperties.CATEGORY_GENERAL) + .defaultValue(CoreProperties.PREVIEW_INCLUDE_PLUGINS_DEFAULT_VALUE) + .build(), + PropertyDefinition.builder(CoreProperties.PREVIEW_EXCLUDE_PLUGINS) + .deprecatedKey(CoreProperties.DRY_RUN_EXCLUDE_PLUGINS) + .name("Plugins excluded for Preview and Incremental modes") + .description("Comma-separated list of plugin keys. Those plugins will not be used during preview or incremental analyses.") + .category(CoreProperties.CATEGORY_GENERAL) + .defaultValue(CoreProperties.PREVIEW_EXCLUDE_PLUGINS_DEFAULT_VALUE) + .build(), + PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_REALM) + .name("Security Realm") + .hidden() + .build(), + PropertyDefinition.builder("sonar.security.savePassword") + .name("Save external password") + .hidden() + .build(), + PropertyDefinition.builder("sonar.authenticator.downcase") + .name("Downcase login") + .description("Downcase login during user authentication, typically for Active Directory") + .type(PropertyType.BOOLEAN) + .defaultValue("false") + .hidden() + .build(), + PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_CREATE_USERS) + .name("Create user accounts") + .description("Create accounts when authenticating users via an external system") + .type(PropertyType.BOOLEAN) + .defaultValue("true") + .hidden() + .build(), + PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_UPDATE_USER_ATTRIBUTES) + .name("Update user attributes") + .description("When using the LDAP or OpenID plugin, at each login, the user attributes (name, email, ...) are re-synchronized") + .hidden() + .type(PropertyType.BOOLEAN) + .defaultValue("true") + .build(), + PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_IGNORE_STARTUP_FAILURE) + .name("Ignore failures during authenticator startup") + .type(PropertyType.BOOLEAN) + .defaultValue("false") + .hidden() + .build(), + PropertyDefinition.builder("sonar.enableFileVariation") + .name("Enable file variation") + .hidden() + .type(PropertyType.BOOLEAN) + .defaultValue("false") + .build(), + PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_LOCAL_USERS) + .name("Local/technical users") + .description("Comma separated list of user logins that will always be authenticated using SonarQube database. " + + "When using the LDAP plugin, for these accounts, the user attributes (name, email, ...) are not re-synchronized") + .type(PropertyType.STRING) + .multiValues(true) + .defaultValue("admin") + .build(), + PropertyDefinition.builder(CoreProperties.SCM_DISABLED_KEY) + .name("Disable the SCM Sensor") + .description("Disable the retrieval of blame information from Source Control Manager") + .category(CoreProperties.CATEGORY_SCM) + .type(PropertyType.BOOLEAN) + .onQualifiers(Qualifiers.PROJECT) + .defaultValue("false") + .build(), + PropertyDefinition.builder(CoreProperties.SCM_PROVIDER_KEY) + .name("Key of the SCM provider for this project") + .description("Force the provider to be used to get SCM information for this project. By default auto-detection is done. Example: svn, git.") + .category(CoreProperties.CATEGORY_SCM) + .onlyOnQualifiers(Qualifiers.PROJECT) + .build(), + // WEB LOOK&FEEL PropertyDefinition.builder("sonar.lf.logoUrl") .deprecatedKey("sonar.branding.image") |