Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.codehaus.plexus:plexus-sec-dispatcher from 2.0 to 3.0.0 #500

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
<version>2.0</version>
<version>3.0.0</version>
<!--NOT provided: will fail on consuming builds -->
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.settings.Server;
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
import org.codehaus.plexus.components.secdispatcher.SecDispatcher;

import ch.ivyteam.ivy.maven.engine.deploy.DeploymentOptionsFileFactory;
import ch.ivyteam.ivy.maven.engine.deploy.http.HttpDeployer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.settings.Server;
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException;
import org.codehaus.plexus.components.secdispatcher.SecDispatcher;
import org.codehaus.plexus.components.secdispatcher.SecDispatcherException;

public class HttpDeployer {
private static final String DEPLOY_URI = "/system/api/apps/";
Expand Down
32 changes: 32 additions & 0 deletions src/test/java/ch/ivyteam/ivy/maven/ProjectMojoRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

import org.apache.maven.plugin.Mojo;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.MojoRule;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.apache.maven.settings.crypto.SettingsDecryptionRequest;
import org.apache.maven.settings.crypto.SettingsDecryptionResult;

import com.google.inject.Binder;
import com.google.inject.Module;

import ch.ivyteam.ivy.maven.util.PathUtils;

Expand All @@ -45,6 +53,30 @@ public class ProjectMojoRule<T extends Mojo> extends MojoRule {
public MavenProject project;

public ProjectMojoRule(Path srcDir, String mojoName) {

super(new AbstractMojoTestCase() {

@Override
protected void addGuiceModules(List<Module> modules) {
// TODO Auto-generated method stub
modules.add(new Module() {

@Override
public void configure(Binder binder) {
binder.bind(SettingsDecrypter.class).toInstance(new SettingsDecrypter() {

@Override
public SettingsDecryptionResult decrypt(SettingsDecryptionRequest request) {
return null;

}
});
}
});
}

});

this.templateProjectDir = srcDir;
this.mojoName = mojoName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public void canDeployRemoteIar_settingsPassword() throws Exception {

@Test
public void canDeployRemoteIar_encryptedSettingsPassword() throws Exception {
System.setProperty("mySecret", "{6WlTulMQMcoHxrDwOe2HsWLAK691wYqfu+BQdByC+SU=}");
addServerConnection("{VUpeDRRbfD4Hmk9WLKzhqLkLttTCsWfLtr75Nt9K/3k=}");
System.setProperty("settings.security",
TestDeployToRunningEngine.class.getResource("settings-security.xml").getPath());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<settingsSecurity>
<master>{6WlTulMQMcoHxrDwOe2HsWLAK691wYqfu+BQdByC+SU=}</master>
<masterSource>prop:mySecret</masterSource>
<masterCipher>AES/GCM/NoPadding</masterCipher>
</settingsSecurity>
Loading