Adjust to changes from Boot 3.3.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -57,7 +57,7 @@
|
||||
<!-- We need to have compatibility with Gradle -->
|
||||
<groovy.version>4.0.16</groovy.version>
|
||||
<!-- We need to have compatibility with Boot -->
|
||||
<maven.version>3.6.3</maven.version>
|
||||
<maven.version>3.9.4</maven.version>
|
||||
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
||||
<!-- Resolver has to be aligned with Maven (e.g resolver 1.4 and Maven 3.6 or resolver 1.3 and Maven 3.5) -->
|
||||
<maven.resolver.version>1.9.18</maven.resolver.version>
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
package org.springframework.cloud.contract.stubrunner;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
|
||||
import org.sonatype.plexus.components.cipher.PlexusCipherException;
|
||||
import org.sonatype.plexus.components.cipher.PlexusCipher;
|
||||
import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
|
||||
import shaded.org.apache.maven.settings.crypto.DefaultSettingsDecrypter;
|
||||
import shaded.org.apache.maven.settings.crypto.SettingsDecrypter;
|
||||
@@ -30,6 +31,8 @@ public class MavenSettings {
|
||||
|
||||
private static final String MAVEN_USER_CONFIG_DIRECTORY = "maven.user.config.dir";
|
||||
|
||||
private static final String SECURITY_XML = "settings-security.xml";
|
||||
|
||||
private final String homeDir;
|
||||
|
||||
public MavenSettings() {
|
||||
@@ -57,22 +60,16 @@ public class MavenSettings {
|
||||
}
|
||||
|
||||
public SettingsDecrypter createSettingsDecrypter() {
|
||||
return new DefaultSettingsDecrypter(new SpringCloudContractSecDispatcher());
|
||||
File file = new File(MavenSettings.this.homeDir, SECURITY_XML);
|
||||
String configurationFilePath = file.getAbsolutePath();
|
||||
return new DefaultSettingsDecrypter(
|
||||
new SpringCloudContractSecDispatcher(new DefaultPlexusCipher(), configurationFilePath));
|
||||
}
|
||||
|
||||
private class SpringCloudContractSecDispatcher extends DefaultSecDispatcher {
|
||||
private static class SpringCloudContractSecDispatcher extends DefaultSecDispatcher {
|
||||
|
||||
private static final String SECURITY_XML = "settings-security.xml";
|
||||
|
||||
SpringCloudContractSecDispatcher() {
|
||||
File file = new File(MavenSettings.this.homeDir, SECURITY_XML);
|
||||
this._configurationFile = file.getAbsolutePath();
|
||||
try {
|
||||
this._cipher = new DefaultPlexusCipher();
|
||||
}
|
||||
catch (PlexusCipherException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
SpringCloudContractSecDispatcher(PlexusCipher cipher, String configurationFile) {
|
||||
super(cipher, new HashMap<>(), configurationFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ import org.springframework.test.context.ActiveProfiles
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
// tag::test[]
|
||||
@SpringBootTest(classes = Config, properties = ["spring.application.name=bar-consumer"])
|
||||
@SpringBootTest(classes = Config, properties = ["spring.application.name=bar-consumer",
|
||||
"stubrunner.jms.enabled=false"])
|
||||
@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
|
||||
repositoryRoot = "classpath:m2repo/repository/",
|
||||
stubsMode = StubRunnerProperties.StubsMode.REMOTE,
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.test.context.ActiveProfiles
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
// tag::test[]
|
||||
@SpringBootTest(classes = Config)
|
||||
@SpringBootTest(classes = Config, properties = "stubrunner.jms.enabled=false")
|
||||
@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
|
||||
repositoryRoot = "classpath:m2repo/repository/",
|
||||
consumerName = "foo-consumer",
|
||||
|
||||
@@ -21,6 +21,6 @@ aetherVersion=1.1.0
|
||||
springCloudBuildVersion=4.1.1-SNAPSHOT
|
||||
springVersion=6.0.10
|
||||
jacksonDatabindVersion=2.13.2.1
|
||||
mavenResolverVersion=1.4.1
|
||||
mavenResolverVersion=1.9.18
|
||||
jgitVersion=5.12.0.202106070339-r
|
||||
jschVersion=0.0.9
|
||||
|
||||
Reference in New Issue
Block a user