diff options
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); + } + } } |