From: Julien HENRY Date: Thu, 24 Apr 2014 08:21:58 +0000 (+0200) Subject: Revert "SONAR-5051 Support Maven encryption mechanism for SonarQube passwords" X-Git-Tag: 4.3~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a4962a39ea4412ae9a05535d00968536e20c373c;p=sonarqube.git Revert "SONAR-5051 Support Maven encryption mechanism for SonarQube passwords" This reverts commit 854f66c3360141bcdd5c59dd5b6215472ee8ca17. --- diff --git a/sonar-maven-plugin/pom.xml b/sonar-maven-plugin/pom.xml index ad18cff7b79..00e8fb9a021 100644 --- a/sonar-maven-plugin/pom.xml +++ b/sonar-maven-plugin/pom.xml @@ -34,12 +34,6 @@ maven-project provided - - org.sonatype.plexus - plexus-sec-dispatcher - 1.4 - compile - 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 0164c2e0c11..dfc313844a2 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 @@ -35,12 +35,9 @@ import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; import org.sonar.runner.api.EmbeddedRunner; import org.sonar.runner.api.RunnerProperties; import org.sonar.runner.api.ScanProperties; -import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; -import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException; import java.io.File; import java.io.IOException; -import java.util.Properties; /** * @goal sonar @@ -129,13 +126,6 @@ public final class SonarMojo extends AbstractMojo { */ RuntimeInformation runtimeInformation; - /** - * Plexus component for the SecDispatcher - * @component role="org.sonatype.plexus.components.sec.dispatcher.SecDispatcher" - * @required - */ - private SecDispatcher securityDispatcher; - @Override public void execute() throws MojoExecutionException { ArtifactVersion mavenVersion = getMavenVersion(); @@ -180,8 +170,6 @@ public final class SonarMojo extends AbstractMojo { if (getLog().isDebugEnabled()) { runner.setProperty("sonar.verbose", "true"); } - // Replace all properties by decrypted ones if applicable - runner.addProperties(decryptProperties(runner.properties())); runner.execute(); } catch (Exception e) { throw ExceptionHandling.handle(e, getLog()); @@ -227,26 +215,4 @@ public final class SonarMojo extends AbstractMojo { return null; } - public Properties decryptProperties(Properties properties) { - Properties newProperties = new Properties(); - try { - for (String key : properties.stringPropertyNames()) { - if (key.contains(".password")) { - decrypt(properties, newProperties, key); - } - } - } catch (Exception e) { - getLog().warn("Unable to decrypt properties", e); - } - 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); - } - } } diff --git a/sonar-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/sonar-maven-plugin/src/main/resources/META-INF/plexus/components.xml deleted file mode 100644 index 0101f8e0536..00000000000 --- a/sonar-maven-plugin/src/main/resources/META-INF/plexus/components.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - org.sonatype.plexus.components.sec.dispatcher.SecDispatcher - default - org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher - - - org.sonatype.plexus.components.cipher.PlexusCipher - default - _cipher - - - - <_configuration-file>~/.m2/settings-security.xml - - - - org.sonatype.plexus.components.cipher.PlexusCipher - default - org.sonatype.plexus.components.cipher.DefaultPlexusCipher - - -