diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-03-26 16:31:26 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-03-26 16:31:47 +0100 |
commit | 88823aa9297fda7aa0fcf0e3b79e55747978a0fb (patch) | |
tree | eafb27f91d5bcf5ec1705b5ad022e4e2a7d81023 /sonar-maven-plugin | |
parent | 74255d29d42c2eca4ce0e4a89dc0b8686b9e50a3 (diff) | |
download | sonarqube-88823aa9297fda7aa0fcf0e3b79e55747978a0fb.tar.gz sonarqube-88823aa9297fda7aa0fcf0e3b79e55747978a0fb.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-maven-plugin')
-rw-r--r-- | sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java index 8cb4d94460e..0164c2e0c11 100644 --- a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java +++ b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java @@ -232,12 +232,7 @@ public final class SonarMojo extends AbstractMojo { try { for (String key : properties.stringPropertyNames()) { if (key.contains(".password")) { - try { - String decrypted = securityDispatcher.decrypt(properties.getProperty(key)); - newProperties.setProperty(key, decrypted); - } catch (SecDispatcherException e) { - getLog().warn("Unable to decrypt property " + key, e); - } + decrypt(properties, newProperties, key); } } } catch (Exception e) { @@ -245,4 +240,13 @@ public final class SonarMojo extends AbstractMojo { } return newProperties; } + + private void decrypt(Properties properties, Properties newProperties, String key) { + try { + String decrypted = securityDispatcher.decrypt(properties.getProperty(key)); + newProperties.setProperty(key, decrypted); + } catch (SecDispatcherException e) { + getLog().warn("Unable to decrypt property " + key, e); + } + } } |