getConvertToYaml() {
return convertToYaml;
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateClientStubsFromDslTask.java b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateClientStubsFromDslTask.java
index 175c1a4503..b20c60b78d 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateClientStubsFromDslTask.java
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateClientStubsFromDslTask.java
@@ -40,6 +40,7 @@
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;
+import org.gradle.process.ExecOperations;
import org.springframework.util.StringUtils;
//TODO: Implement as an incremental task: https://gradle.org/docs/current/userguide/custom_tasks.html#incremental_tasks ?
@@ -67,8 +68,15 @@ class GenerateClientStubsFromDslTask extends DefaultTask {
private final DirectoryProperty stubsOutputDir;
+ final ExecOperations executors;
+
@Inject
- public GenerateClientStubsFromDslTask(ObjectFactory objects) {
+ public GenerateClientStubsFromDslTask(
+ final ObjectFactory objects,
+ final ExecOperations executors
+ ) {
+ this.executors = executors;
+
contractsDslDir = objects.directoryProperty();
excludedFiles = objects.listProperty(String.class);
excludeBuildFolders = objects.property(Boolean.class);
@@ -90,7 +98,7 @@ void generate() {
os = NullOutputStream.INSTANCE;
}
try {
- getProject().javaexec(exec -> {
+ executors.javaexec(exec -> {
exec.getMainClass().set("org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverterApplication");
exec.classpath(classpath);
exec.args(quoteAndEscape(output.getAbsolutePath()), quoteAndEscape(contractsDslDir.get().getAsFile().getAbsolutePath()),
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateServerTestsTask.java b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateServerTestsTask.java
index cce26ffef9..eee13489a2 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateServerTestsTask.java
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/GenerateServerTestsTask.java
@@ -42,6 +42,7 @@
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;
+import org.gradle.process.ExecOperations;
import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties;
import org.springframework.cloud.contract.verifier.config.TestFramework;
import org.springframework.cloud.contract.verifier.config.TestMode;
@@ -97,8 +98,15 @@ class GenerateServerTestsTask extends DefaultTask {
private final DirectoryProperty generatedTestResourcesDir;
+ final ExecOperations executors;
+
@Inject
- public GenerateServerTestsTask(ObjectFactory objects) {
+ public GenerateServerTestsTask(
+ final ObjectFactory objects,
+ final ExecOperations executors
+ ) {
+ this.executors = executors;
+
this.contractsDslDir = objects.directoryProperty();
this.nameSuffixForTests = objects.property(String.class);
this.basePackageForTests = objects.property(String.class);
@@ -139,8 +147,8 @@ void generate() {
}
try {
String propertiesJson = new ObjectMapper().writeValueAsString(properties);
- getProject().javaexec(exec -> {
- exec.setMain("org.springframework.cloud.contract.verifier.TestGeneratorApplication");
+ executors.javaexec(exec -> {
+ exec.getMainClass().set("org.springframework.cloud.contract.verifier.TestGeneratorApplication");
exec.classpath(classpath);
exec.args(quoteAndEscape(propertiesJson));
exec.setStandardOutput(os);
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/PublishStubsToScmTask.java b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/PublishStubsToScmTask.java
index df423dd70f..d27e081375 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/PublishStubsToScmTask.java
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/PublishStubsToScmTask.java
@@ -23,6 +23,7 @@
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.MapProperty;
import org.gradle.api.provider.Property;
+import org.gradle.api.provider.ProviderFactory;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputDirectory;
import org.gradle.api.tasks.Nested;
@@ -40,7 +41,7 @@
/**
* For SCM based repositories will copy the generated stubs to the cloned repo with
* contracts and stubs. Will also commit the changes and push them to origin.
- *
+ *
* NOTE: starting with 2.3.0.RELEASE the customize{}
closure previously used
* for {@link PublishStubsToScmTask} customisation is no longer available. The settings
* should be applied directly within the publishStubsToScm
closure as in the
@@ -60,7 +61,7 @@ class PublishStubsToScmTask extends DefaultTask {
private final Property contractsMode;
/**
- * @see ContractVerifierExtension#deleteStubsAfterTest
+ * @see ContractVerifierExtension#getDeleteStubsAfterTest()
*
* This property will delete the Git repository where the input stubs to this task
* have been committed.
@@ -73,8 +74,15 @@ class PublishStubsToScmTask extends DefaultTask {
private final DirectoryProperty stubsDir;
+ private final Property projectGroup;
+ private final Property projectName;
+ private final Property projectVersion;
+
@Inject
- public PublishStubsToScmTask(ObjectFactory objects) {
+ public PublishStubsToScmTask(
+ final ObjectFactory objects,
+ final ProviderFactory providers
+ ) {
this.contractRepository = objects.newInstance(Repository.class);
this.contractsMode = objects.property(StubRunnerProperties.StubsMode.class);
this.deleteStubsAfterTest = objects.property(Boolean.class);
@@ -82,6 +90,10 @@ public PublishStubsToScmTask(ObjectFactory objects) {
this.contractsProperties = objects.mapProperty(String.class, String.class);
this.stubsDir = objects.directoryProperty();
+ projectGroup = objects.property(String.class).convention(providers.provider(() -> getProject().getGroup().toString()));
+ projectName = objects.property(String.class).convention(providers.provider(() -> getProject().getName()));
+ projectVersion = objects.property(String.class).convention(providers.provider(() -> getProject().getVersion().toString()));
+
this.onlyIf(task -> {
String contractRepoUrl = contractRepository.repositoryUrl.getOrElse("");
if (!StringUtils.hasText(contractRepoUrl) || !ScmStubDownloaderBuilder.isProtocolAccepted(contractRepoUrl)) {
@@ -96,11 +108,10 @@ public PublishStubsToScmTask(ObjectFactory objects) {
@TaskAction
void publishStubsToScm() {
- String projectName = getProject().getGroup().toString() + ":" + getProject().getName() + ":"
- + getProject().getVersion().toString();
- getLogger().info("Pushing Stubs to SCM for project [{}]", projectName);
+ String projectGroupNameVersion = projectGroup.get() + ":" + projectName.get() + ":" + projectVersion.get();
+ getLogger().info("Pushing Stubs to SCM for project [{}]", projectGroupNameVersion);
StubRunnerOptions stubRunnerOptions = createStubRunnerOptions();
- new ContractProjectUpdater(stubRunnerOptions).updateContractProject(projectName,
+ new ContractProjectUpdater(stubRunnerOptions).updateContractProject(projectGroupNameVersion,
stubsDir.get().getAsFile().toPath());
}
@@ -202,4 +213,7 @@ private StubRunnerOptions createStubRunnerOptions() {
return options.build();
}
+ @Input protected Property getProjectGroup() { return projectGroup; }
+ @Input protected Property getProjectName() { return projectName; }
+ @Input protected Property getProjectVersion() { return projectVersion; }
}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.java b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.java
index 28f849552d..332f41d92a 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.java
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/java/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.java
@@ -16,6 +16,12 @@
package org.springframework.cloud.contract.verifier.plugin;
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.inject.Inject;
+
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
@@ -25,18 +31,21 @@
import org.gradle.api.attributes.LibraryElements;
import org.gradle.api.attributes.Usage;
import org.gradle.api.file.Directory;
-import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.FileCollection;
+import org.gradle.api.file.ProjectLayout;
import org.gradle.api.internal.HasConvention;
+import org.gradle.api.logging.Logger;
+import org.gradle.api.logging.Logging;
+import org.gradle.api.model.ObjectFactory;
import org.gradle.api.plugins.GroovyPlugin;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
+import org.gradle.api.plugins.JvmTestSuitePlugin;
+import org.gradle.api.plugins.jvm.JvmTestSuite;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
-import org.gradle.api.publish.PublishingExtension;
-import org.gradle.api.publish.maven.MavenPublication;
-import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
+import org.gradle.api.provider.ProviderFactory;
import org.gradle.api.tasks.GroovySourceSet;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetContainer;
@@ -44,10 +53,10 @@
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.bundling.Jar;
import org.gradle.api.tasks.testing.Test;
+import org.gradle.testing.base.TestingExtension;
+import org.gradle.util.GradleVersion;
import org.springframework.cloud.contract.verifier.config.TestFramework;
-import java.io.File;
-
/**
* Gradle plugin for Spring Cloud Contract Verifier that from the DSL contract can
*
@@ -63,6 +72,8 @@
*/
public class SpringCloudContractVerifierGradlePlugin implements Plugin {
+ private static final Logger logger = Logging.getLogger(SpringCloudContractVerifierGradlePlugin.class);
+
private static final String SPRING_CLOUD_VERSION = VersionExtractor.forClass(SpringCloudContractVerifierGradlePlugin.class);
private static final String GROUP_NAME = "Verification";
@@ -87,48 +98,91 @@ public class SpringCloudContractVerifierGradlePlugin implements Plugin
private Project project;
+ private final ProjectLayout layout;
+ private final ProviderFactory providers;
+ private final ObjectFactory objects;
+
+ @Inject
+ public SpringCloudContractVerifierGradlePlugin(
+ final ProjectLayout layout,
+ final ProviderFactory providers,
+ final ObjectFactory objects
+ ) {
+ this.layout = layout;
+ this.providers = providers;
+ this.objects = objects;
+ }
+
@Override
public void apply(Project project) {
this.project = project;
project.getPlugins().apply(JavaPlugin.class);
+ project.getPlugins().apply(JvmTestSuitePlugin.class);
ContractVerifierExtension extension = project.getExtensions().create(EXTENSION_NAME,
ContractVerifierExtension.class);
- JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
- SourceSet contractTestSourceSet = configureSourceSets(extension, javaConvention);
- configureConfigurations();
- registerContractTestTask(contractTestSourceSet);
-
- TaskProvider copyContracts = createAndConfigureCopyContractsTask(extension);
- TaskProvider generateClientStubs = createAndConfigureGenerateClientStubs(
+ TaskProvider copyContracts = registerCopyContractsTask(extension);
+ TaskProvider generateClientStubs = registerGenerateClientStubsTask(
extension, copyContracts);
- createAndConfigureStubsJarTasks(extension, copyContracts, generateClientStubs);
- createGenerateTestsTask(extension, contractTestSourceSet, copyContracts);
- createAndConfigurePublishStubsToScmTask(extension, generateClientStubs);
+ registerStubsJarTask(extension, copyContracts, generateClientStubs);
+ TaskProvider generateServerTestsTaskProvider =
+ registerGenerateServerTestsTask(extension, copyContracts);
+ registerPublishStubsToScmTask(extension, generateClientStubs);
- project.getDependencies().add(CONTRACT_TEST_GENERATOR_RUNTIME_CLASSPATH_CONFIGURATION_NAME, "org.springframework.cloud:spring-cloud-contract-converters:" + SPRING_CLOUD_VERSION);
- project.afterEvaluate(inner -> {
- DirectoryProperty generatedTestSourcesDir = extension.getGeneratedTestSourcesDir();
- if (generatedTestSourcesDir.isPresent()) {
- if (extension.getTestFramework().get() == TestFramework.SPOCK) {
- project.getPlugins().withType(GroovyPlugin.class, groovyPlugin -> {
- GroovySourceSet groovy = ((HasConvention) contractTestSourceSet).getConvention()
- .getPlugin(GroovySourceSet.class);
- groovy.getGroovy().srcDirs(generatedTestSourcesDir);
- });
- }
- else {
- contractTestSourceSet.getJava().srcDirs(generatedTestSourcesDir);
+ JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
+ TestingExtension testing = project.getExtensions().getByType(TestingExtension.class);
+ testing.getSuites().register("contractTest", JvmTestSuite.class, contractTestSuite -> {
+ contractTestSuite.useJUnitJupiter();
+
+ contractTestSuite.dependencies(dependencies -> {
+ if (GradleVersion.current().compareTo(GradleVersion.version("7.6")) < 0) {
+ try {
+ Method implementation = dependencies.getClass().getMethod("implementation", Object.class);
+ implementation.invoke(dependencies, project);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
+ throw new RuntimeException("Unable to add project dependencies", e);
+ }
+ } else {
+ dependencies.getImplementation().add(dependencies.project());
}
- }
+ });
+
+ contractTestSuite.sources(sourceSet -> {
+ configureSourceSets(extension, javaConvention, sourceSet);
+
+ project.getTasks().named(sourceSet.getProcessResourcesTaskName(), processContractTestResourcesTask -> {
+ processContractTestResourcesTask.dependsOn(generateServerTestsTaskProvider);
+ });
+ project.getTasks().named(sourceSet.getCompileJavaTaskName(), compileContractTestJava -> compileContractTestJava.dependsOn(generateServerTestsTaskProvider));
+ project.getPlugins().withType(GroovyPlugin.class, groovyPlugin -> {
+ project.getTasks().named(sourceSet.getCompileTaskName("groovy"), compileContractTestGroovy -> {
+ compileContractTestGroovy.dependsOn(generateServerTestsTaskProvider);
+ });
+ });
+ project.getPlugins().withId("kotlin", kotlinPlugin -> {
+ project.getTasks().named(sourceSet.getCompileTaskName("kotlin"), compileContractTestKotlin -> {
+ compileContractTestKotlin.dependsOn(generateServerTestsTaskProvider);
+ });
+ });
+ project.getPlugins().withId("org.jetbrains.kotlin.jvm", kotlinJvmPlugin -> {
+ project.getTasks().named(sourceSet.getCompileTaskName("kotlin"), compileContractTestKotlin -> {
+ compileContractTestKotlin.dependsOn(generateServerTestsTaskProvider);
+ });
+ });
+ });
+
+ contractTestSuite.getTargets().all(testSuiteTarget -> configureTestTask(testSuiteTarget.getTestTask()));
});
+
+ configureConfigurations();
+
+ project.getDependencies().add(CONTRACT_TEST_GENERATOR_RUNTIME_CLASSPATH_CONFIGURATION_NAME, "org.springframework.cloud:spring-cloud-contract-converters:" + SPRING_CLOUD_VERSION);
}
- private SourceSet configureSourceSets(ContractVerifierExtension extension, JavaPluginConvention javaConvention) {
+ private SourceSet configureSourceSets(ContractVerifierExtension extension, JavaPluginConvention javaConvention, SourceSet contractTest) {
SourceSetContainer sourceSets = javaConvention.getSourceSets();
- SourceSet contractTest = sourceSets.create(CONTRACT_TEST_SOURCE_SET_NAME);
contractTest.getJava().srcDirs(extension.getGeneratedTestJavaSourcesDir());
project.getPlugins().withType(GroovyPlugin.class, groovyPlugin -> {
GroovySourceSet groovy = ((HasConvention) contractTest).getConvention().getPlugin(GroovySourceSet.class);
@@ -167,30 +221,27 @@ private void configureConfigurations() {
conf.setCanBeResolved(true);
conf.setCanBeConsumed(false);
conf.attributes(attributes -> {
- attributes.attribute(Usage.USAGE_ATTRIBUTE, project.getObjects().named(Usage.class, Usage.JAVA_RUNTIME));
- attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.getObjects().named(Category.class, Category.LIBRARY));
- attributes.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.getObjects().named(LibraryElements.class, LibraryElements.JAR));
- attributes.attribute(Bundling.BUNDLING_ATTRIBUTE, project.getObjects().named(Bundling.class, Bundling.EXTERNAL));
+ attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Usage.JAVA_RUNTIME));
+ attributes.attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.class, Category.LIBRARY));
+ attributes.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.class, LibraryElements.JAR));
+ attributes.attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.class, Bundling.EXTERNAL));
});
conf.extendsFrom(configurations.getByName(CONTRACT_TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME));
});
}
- private void registerContractTestTask(SourceSet contractTestSourceSet) {
- TaskProvider contractTestTask = project.getTasks().register(CONTRACT_TEST_TASK_NAME, Test.class,
- contractTest -> {
- contractTest.setDescription("Runs the contract tests");
- contractTest.setGroup(GROUP_NAME);
- contractTest.setTestClassesDirs(contractTestSourceSet.getOutput().getClassesDirs());
- contractTest.setClasspath(contractTestSourceSet.getRuntimeClasspath());
+ private void configureTestTask(TaskProvider contractTestTaskProvider) {
+ contractTestTaskProvider.configure(contractTest -> {
+ contractTest.setDescription("Runs the contract tests");
+ contractTest.setGroup(GROUP_NAME);
- contractTest.mustRunAfter(project.getTasks().named(JavaPlugin.TEST_TASK_NAME));
- });
+ contractTest.shouldRunAfter(project.getTasks().named(JavaPlugin.TEST_TASK_NAME));
+ });
- project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME, check -> check.dependsOn(contractTestTask));
+ project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME, check -> check.dependsOn(contractTestTaskProvider));
}
- private void createGenerateTestsTask(ContractVerifierExtension extension, SourceSet contractTestSourceSet,
+ private TaskProvider registerGenerateServerTestsTask(ContractVerifierExtension extension,
TaskProvider copyContracts) {
TaskProvider task = project.getTasks().register(GenerateServerTestsTask.TASK_NAME,
GenerateServerTestsTask.class);
@@ -222,38 +273,21 @@ private void createGenerateTestsTask(ContractVerifierExtension extension, Source
Property correctSourceSetDir;
if (testFramework == TestFramework.SPOCK) {
correctSourceSetDir = extension.getGeneratedTestGroovySourcesDir();
+ return extension.getGeneratedTestGroovySourcesDir().orElse(correctSourceSetDir);
}
else {
correctSourceSetDir = extension.getGeneratedTestJavaSourcesDir();
+ return extension.getGeneratedTestJavaSourcesDir().orElse(correctSourceSetDir);
}
- return extension.getGeneratedTestSourcesDir().orElse(correctSourceSetDir);
}));
generateServerTestsTask.getGeneratedTestResourcesDir().convention(extension.getGeneratedTestResourcesDir());
generateServerTestsTask.dependsOn(copyContracts);
});
- project.getTasks().named(contractTestSourceSet.getProcessResourcesTaskName(), processContractTestResourcesTask -> {
- processContractTestResourcesTask.dependsOn(task);
- });
- project.getTasks().named(contractTestSourceSet.getCompileJavaTaskName(), compileContractTestJava -> compileContractTestJava.dependsOn(task));
- project.getPlugins().withType(GroovyPlugin.class, groovyPlugin -> {
- project.getTasks().named(contractTestSourceSet.getCompileTaskName("groovy"), compileContractTestGroovy -> {
- compileContractTestGroovy.dependsOn(task);
- });
- });
- project.getPlugins().withId("kotlin", kotlinPlugin -> {
- project.getTasks().named(contractTestSourceSet.getCompileTaskName("kotlin"), compileContractTestKotlin -> {
- compileContractTestKotlin.dependsOn(task);
- });
- });
- project.getPlugins().withId("org.jetbrains.kotlin.jvm", kotlinJvmPlugin -> {
- project.getTasks().named(contractTestSourceSet.getCompileTaskName("kotlin"), compileContractTestKotlin -> {
- compileContractTestKotlin.dependsOn(task);
- });
- });
+ return task;
}
- private void createAndConfigurePublishStubsToScmTask(ContractVerifierExtension extension,
+ private void registerPublishStubsToScmTask(ContractVerifierExtension extension,
TaskProvider generateClientStubs) {
TaskProvider task = project.getTasks().register(PublishStubsToScmTask.TASK_NAME,
PublishStubsToScmTask.class);
@@ -285,7 +319,7 @@ private void createAndConfigurePublishStubsToScmTask(ContractVerifierExtension e
});
}
- private TaskProvider createAndConfigureGenerateClientStubs(
+ private TaskProvider registerGenerateClientStubsTask(
ContractVerifierExtension extension, TaskProvider copyContracts) {
TaskProvider task = project.getTasks().register(
GenerateClientStubsFromDslTask.TASK_NAME, GenerateClientStubsFromDslTask.class, generateClientStubs -> {
@@ -307,14 +341,14 @@ private TaskProvider createAndConfigureGenerateC
return task;
}
- private void createAndConfigureStubsJarTasks(ContractVerifierExtension extension,
+ private void registerStubsJarTask(ContractVerifierExtension extension,
TaskProvider copyContracts,
TaskProvider generateClientStubs) {
TaskProvider verifierStubsJar = project.getTasks().register(VERIFIER_STUBS_JAR_TASK_NAME, Jar.class);
verifierStubsJar.configure(stubsJar -> {
stubsJar.setDescription("Creates the stubs JAR task");
stubsJar.setGroup(GROUP_NAME);
- stubsJar.getArchiveBaseName().convention(project.provider(project::getName));
+ stubsJar.getArchiveBaseName().convention(providers.provider(project::getName));
stubsJar.getArchiveClassifier().convention(extension.getStubsSuffix());
stubsJar.from(extension.getStubsOutputDir());
@@ -322,61 +356,9 @@ private void createAndConfigureStubsJarTasks(ContractVerifierExtension extension
stubsJar.dependsOn(generateClientStubs);
});
project.artifacts(artifactHandler -> artifactHandler.add("archives", verifierStubsJar));
- createAndConfigureMavenPublishPlugin(verifierStubsJar, extension);
- }
-
- @Deprecated
- private void createAndConfigureMavenPublishPlugin(TaskProvider stubsTask,
- ContractVerifierExtension extension) {
- if (!classIsOnClasspath("org.gradle.api.publish.maven.plugins.MavenPublishPlugin")) {
- project.getLogger().debug("Maven Publish Plugin is not present - won't add default publication");
- return;
- }
- // This must be called within afterEvaluate due to getting data from extension,
- // which must be initialised first:
- project.afterEvaluate(inner -> {
- project.getLogger().debug("Spring Cloud Contract Verifier Plugin: Generating default publication");
- if (extension.getDisableStubPublication().get()) {
- project.getLogger().info("You've switched off the stub publication - won't add default publication");
- return;
- }
- project.getPlugins().withType(MavenPublishPlugin.class, publishingPlugin -> {
- PublishingExtension publishingExtension = project.getExtensions().findByType(PublishingExtension.class);
- if (hasStubsPublication(publishingExtension)) {
- project.getLogger().info(
- "Spring Cloud Contract Verifier Plugin: Stubs publication was present - won't create a new one. Remember about passing stubs as artifact");
- }
- else {
- project.getLogger().debug(
- "Spring Cloud Contract Verifier Plugin: Stubs publication is not present - will create one");
- setPublications(publishingExtension, stubsTask);
- }
- });
- });
- }
-
- @Deprecated
- private void setPublications(PublishingExtension publishingExtension, TaskProvider stubsTask) {
- project.getLogger().warn("Spring Cloud Contract Verifier Plugin: Creating stubs publication is deprecated");
- publishingExtension.publications(publicationsContainer -> {
- publicationsContainer.create("stubs", MavenPublication.class, stubsPublication -> {
- stubsPublication.setArtifactId(project.getName());
- stubsPublication.artifact(stubsTask.get());
- });
- });
- }
-
- @Deprecated
- private boolean hasStubsPublication(PublishingExtension publishingExtension) {
- try {
- return publishingExtension.getPublications().getByName("stubs") != null;
- }
- catch (Exception e) {
- return false;
- }
}
- private TaskProvider createAndConfigureCopyContractsTask(ContractVerifierExtension extension) {
+ private TaskProvider registerCopyContractsTask(ContractVerifierExtension extension) {
TaskProvider task = project.getTasks().register(ContractsCopyTask.TASK_NAME,
ContractsCopyTask.class, contractsCopyTask -> {
contractsCopyTask.setGroup(GROUP_NAME);
@@ -386,17 +368,17 @@ private TaskProvider createAndConfigureCopyContractsTask(Cont
contractsCopyTask.getFailOnNoContracts().convention(extension.getFailOnNoContracts());
contractsCopyTask.getContractsDirectory()
.convention(extension.getContractsDslDir().flatMap(contractsDslDir -> {
- return project.provider(() -> {
+ return providers.provider(() -> {
if (contractsDslDir.getAsFile().exists()) {
return contractsDslDir;
}
else {
- Directory legacyContractsDslDir = project.getLayout().getProjectDirectory()
+ Directory legacyContractsDslDir = layout.getProjectDirectory()
.dir("src/test/resources/contracts");
if (legacyContractsDslDir.getAsFile().exists()) {
- project.getLogger().warn(
- "Spring Cloud Contract Verifier Plugin: Locating contracts in is deprecated and will be removed in a future release. Please move them to .");
- return legacyContractsDslDir;
+ logger.warn(
+ "Spring Cloud Contract Verifier Plugin: Locating contracts in has been removed. Please move them to . This warning message will be removed in a future release.");
+ return contractsDslDir;
}
else {
return null;
@@ -440,26 +422,18 @@ private TaskProvider createAndConfigureCopyContractsTask(Cont
return task;
}
- @Deprecated
- private boolean classIsOnClasspath(String className) {
- try {
- Class.forName(className);
- return true;
- }
- catch (Exception e) {
- project.getLogger().debug("Maven Publish Plugin is not available");
- }
- return false;
- }
-
private Provider buildRootPath(String path) {
- return project.provider(() -> {
- StringBuilder builder = new StringBuilder();
- builder.append("META-INF").append(File.separator).append(project.getGroup()).append(File.separator)
- .append(project.getName()).append(File.separator).append(project.getVersion())
- .append(File.separator).append(path);
- return builder.toString();
- });
+ return providers.provider(() ->
+ "META-INF"
+ + File.separator
+ + project.getGroup()
+ + File.separator
+ + project.getName()
+ + File.separator
+ + project.getVersion()
+ + File.separator
+ + path
+ );
}
}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierIntegrationSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierIntegrationTest.groovy
similarity index 98%
rename from spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierIntegrationSpec.groovy
rename to spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierIntegrationTest.groovy
index b1d7ca2633..51ec3c6c35 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierIntegrationSpec.groovy
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierIntegrationTest.groovy
@@ -28,11 +28,11 @@ import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.BuildTask
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
-import spock.lang.Specification
+import org.junit.jupiter.api.BeforeEach
import static java.nio.charset.StandardCharsets.UTF_8
-abstract class ContractVerifierIntegrationSpec extends Specification {
+abstract class ContractVerifierIntegrationTest {
public static final String SPOCK = "testFramework = 'Spock'"
public static final String JUNIT = "testFramework = 'JUnit'"
@@ -42,7 +42,8 @@ abstract class ContractVerifierIntegrationSpec extends Specification {
File testProjectDir
- def setup() {
+ @BeforeEach
+ void setup() {
def dateString = new Date().format("yyyy-MM-dd_HH-mm-ss")
def testFolder = new File("build/generated-tests/${getClass().simpleName}/${dateString}")
testFolder.mkdirs()
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierKotlinIntegrationSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierKotlinIntegrationTest.groovy
similarity index 93%
rename from spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierKotlinIntegrationSpec.groovy
rename to spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierKotlinIntegrationTest.groovy
index 83e225e85c..e23cb69926 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierKotlinIntegrationSpec.groovy
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierKotlinIntegrationTest.groovy
@@ -21,7 +21,7 @@ import java.nio.file.Path
import static java.nio.charset.StandardCharsets.UTF_8
-abstract class ContractVerifierKotlinIntegrationSpec extends ContractVerifierIntegrationSpec {
+abstract class ContractVerifierKotlinIntegrationTest extends ContractVerifierIntegrationTest {
public static final String SPOCK = "testFramework.set(TestFramework.SPOCK)"
public static final String JUNIT = "testFramework.set(TestFramework.JUNIT)"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy
deleted file mode 100644
index e3c66b0744..0000000000
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.plugin
-
-
-import org.gradle.api.artifacts.Configuration
-import org.gradle.api.file.Directory
-import org.gradle.api.internal.project.DefaultProject
-import org.gradle.api.plugins.GroovyPlugin
-import org.gradle.api.plugins.JavaPlugin
-import org.gradle.api.plugins.JavaPluginConvention
-import org.gradle.api.publish.PublicationContainer
-import org.gradle.api.publish.PublishingExtension
-import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
-import org.gradle.api.tasks.SourceSet
-import org.gradle.testfixtures.ProjectBuilder
-import org.springframework.cloud.contract.verifier.config.TestFramework
-import spock.lang.Specification
-
-class ContractVerifierSpec extends Specification {
- DefaultProject project
-
- def setup() {
- String dateString = new Date().format("yyyy-MM-dd_HH-mm-ss")
- File testFolder = new File("build/generated-tests/${getClass().simpleName}/${dateString}")
- testFolder.mkdirs()
- project = (DefaultProject) ProjectBuilder.builder().withProjectDir(testFolder).build()
- project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
- }
-
- def "should apply java plugin"() {
- expect:
- project.plugins.hasPlugin(JavaPlugin)
- }
-
- def "should create contracts extension"() {
- expect:
- project.extensions.findByType(ContractVerifierExtension) != null
- }
-
- def "should create a test sourceset with java sources"() {
- given:
- ContractVerifierExtension extension = project.extensions.getByType(ContractVerifierExtension)
- Directory projectDir = project.layout.projectDirectory
- SourceSet contractTest = project.convention.getPlugin(JavaPluginConvention).getSourceSets().getByName("contractTest")
-
- expect:
- contractTest != null
- contractTest.java.srcDirs.contains(projectDir.dir("src/contractTest/java").asFile)
- contractTest.java.srcDirs.contains(extension.generatedTestJavaSourcesDir.get().asFile)
- contractTest.resources.srcDirs.contains(projectDir.dir("src/contractTest/resources").asFile)
- contractTest.resources.srcDirs.contains(extension.generatedTestResourcesDir.get().asFile)
- }
-
- def "should create a test sourceset with groovy sources, if the groovy plugin is present"() {
- given:
- project.plugins.apply(GroovyPlugin)
- ContractVerifierExtension extension = project.extensions.getByType(ContractVerifierExtension)
- Directory projectDir = project.layout.projectDirectory
- SourceSet contractTest = project.convention.getPlugin(JavaPluginConvention).getSourceSets().getByName("contractTest")
-
- expect:
- contractTest != null
- contractTest.java.srcDirs.contains(projectDir.dir("src/contractTest/java").asFile)
- contractTest.java.srcDirs.contains(extension.generatedTestJavaSourcesDir.get().asFile)
- contractTest.groovy.srcDirs.contains(projectDir.dir('src/contractTest/groovy').asFile)
- contractTest.groovy.srcDirs.contains(extension.generatedTestGroovySourcesDir.get().asFile)
- contractTest.resources.srcDirs.contains(projectDir.dir("src/contractTest/resources").asFile)
- contractTest.resources.srcDirs.contains(extension.generatedTestResourcesDir.get().asFile)
- }
-
- def "should setup dependency configurations"() {
- given:
- Configuration contractTestCompileOnly = project.configurations.contractTestCompileOnly
- Configuration contractTestImplementation = project.configurations.contractTestImplementation
- Configuration contractTestRuntimeOnly = project.configurations.contractTestRuntimeOnly
-
- expect:
- contractTestCompileOnly != null
- contractTestCompileOnly.extendsFrom.contains(project.configurations.testCompileOnly)
- contractTestImplementation != null
- contractTestImplementation.extendsFrom.contains(project.configurations.testImplementation)
- contractTestRuntimeOnly != null
- contractTestRuntimeOnly.extendsFrom.contains(project.configurations.testRuntimeOnly)
- }
-
- def "should create contract test task"() {
- expect:
- project.tasks.named("contractTest").get() != null
- }
-
- def "should create generateContractTests task"() {
- expect:
- project.tasks.named("generateContractTests").get() != null
- }
-
- def "should configure generateContractTests task as a dependency of the compileContractTestJava task"() {
- expect:
- project.tasks.compileContractTestJava.getDependsOn().contains(project.tasks.named("generateContractTests"))
- project.tasks.findByName("compileContractTestGroovy") == null
- }
-
- def "should configure generateContractTests task as a dependency of the compileContractTestGroovy task"() {
- given:
- project.plugins.apply(GroovyPlugin)
-
- expect:
- project.tasks.compileContractTestJava.getDependsOn().contains(project.tasks.named("generateContractTests"))
- project.tasks.compileContractTestGroovy.getDependsOn().contains(project.tasks.named("generateContractTests"))
- }
-
- def "should configure generatedTestSourcesDir with the appropriate directories"() {
- when:
- ContractVerifierExtension extension = project.extensions.findByType(ContractVerifierExtension)
- GenerateServerTestsTask generateServerTestsTask = project.tasks.getByName("generateContractTests") as GenerateServerTestsTask
-
- then:
- generateServerTestsTask.generatedTestSourcesDir.get().asFile == extension.generatedTestJavaSourcesDir.get().asFile
-
- and:
- extension.testFramework.set(TestFramework.SPOCK)
-
- then:
- generateServerTestsTask.generatedTestSourcesDir.get().asFile == extension.generatedTestGroovySourcesDir.get().asFile
-
- and:
- extension.generatedTestSourcesDir.set(project.file("src/random"))
-
- then:
- generateServerTestsTask.generatedTestSourcesDir.get().asFile == extension.generatedTestSourcesDir.get().asFile
- }
-
- def "should create generateClientStubs task"() {
- expect:
- project.tasks.named("generateClientStubs").get() != null
- }
-
- def "should create verifierStubsJar task"() {
- expect:
- project.tasks.named("verifierStubsJar").get() != null
- }
-
- def "should configure generateClientStubs task as a dependency of the verifierStubsJar task"() {
- expect:
- project.tasks.verifierStubsJar.getDependsOn().contains(project.tasks.named("generateClientStubs"))
- }
-
- def "should configure generateClientStubs task as a dependency of the publishStubsToScm task"() {
- expect:
- project.tasks.publishStubsToScm.getDependsOn().contains(project.tasks.named("generateClientStubs"))
- }
-
- def "should create copyContracts task"() {
- expect:
- project.tasks.named("copyContracts").get() != null
- }
-
- def "should configure copyContracts task as a dependency of the verifierStubsJar task"() {
- expect:
- project.tasks.verifierStubsJar.getDependsOn().contains(project.tasks.named("generateClientStubs"))
- }
-
- /**
- * project.evaluate() is used here in order to trigger the evaluation lifecycle of a project.
- * This method is currently exposed via the internal API and is subject to change, however, Gradle
- * does not yet expose a way to test this portion of the lifecycle.
- *
- * In the next version, this test will be completely removed as publication will be fully a user
- * responsibility.
- */
- @Deprecated
- def "should configure maven-publish plugin, if enabled"() {
- given:
- project.plugins.apply(MavenPublishPlugin)
- project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
- ContractVerifierExtension extension = project.getExtensions().findByType(ContractVerifierExtension)
- extension.with {
- disableStubPublication = false
- }
- project.evaluate() // Currently internal method to trigger afterEvaluate blocks.
-
- expect:
- PublicationContainer publications = project.extensions.getByType(PublishingExtension).publications
- publications.size() > 0
- publications.named("stubs") != null
- }
-
- def "should compile"() {
- given:
- project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
- ContractVerifierExtension extension = project.getExtensions().findByType(ContractVerifierExtension)
- extension.with {
-
- // tag::package_with_base_classes[]
- packageWithBaseClasses = 'com.example.base'
- // end::package_with_base_classes[]
-
- // tag::base_class_mappings[]
- baseClassForTests = "com.example.FooBase"
- baseClassMappings {
- baseClassMapping('.*/com/.*', 'com.example.ComBase')
- baseClassMapping('.*/bar/.*': 'com.example.BarBase')
- }
- // end::base_class_mappings[]
- }
- expect:
- extension
- }
-
- def "should property merge scm repository settings for publishing stubs to scm"() {
- given:
- project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
- ContractVerifierExtension extension = project.extensions.findByType(ContractVerifierExtension)
- PublishStubsToScmTask task = project.tasks.findByName(PublishStubsToScmTask.TASK_NAME)
-
- when:
- extension.contractRepository.with {
- repositoryUrl = "https://git.example.com"
- username = "username"
- password = "password"
- proxyHost = "host"
- proxyPort = 8080
- }
-
- then:
- task.contractRepository.repositoryUrl.get() == "https://git.example.com"
- task.contractRepository.username.get() == "username"
- task.contractRepository.password.get() == "password"
- task.contractRepository.proxyHost.get() == "host"
- task.contractRepository.proxyPort.get() == 8080
-
- and:
- extension.publishStubsToScm.contractRepository.with {
- repositoryUrl = "https://git2.example.com"
- username = "username2"
- password = "password2"
- proxyHost = "host2"
- proxyPort = 8081
- }
-
- then:
- task.contractRepository.repositoryUrl.get() == "https://git2.example.com"
- task.contractRepository.username.get() == "username2"
- task.contractRepository.password.get() == "password2"
- task.contractRepository.proxyHost.get() == "host2"
- task.contractRepository.proxyPort.get() == 8081
- }
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierTest.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierTest.groovy
new file mode 100644
index 0000000000..c004a5a09d
--- /dev/null
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierTest.groovy
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2013-2020 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.contract.verifier.plugin
+
+import org.gradle.api.artifacts.Configuration
+import org.gradle.api.file.Directory
+import org.gradle.api.internal.project.DefaultProject
+import org.gradle.api.plugins.GroovyPlugin
+import org.gradle.api.plugins.JavaPlugin
+import org.gradle.api.plugins.JavaPluginConvention
+import org.gradle.api.publish.PublicationContainer
+import org.gradle.api.publish.PublishingExtension
+import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
+import org.gradle.api.tasks.SourceSet
+import org.gradle.testfixtures.ProjectBuilder
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
+
+import org.springframework.cloud.contract.verifier.config.TestFramework
+
+class ContractVerifierTest {
+ DefaultProject project
+
+ @BeforeEach
+ void setup() {
+ String dateString = new Date().format("yyyy-MM-dd_HH-mm-ss")
+ File testFolder = new File("build/generated-tests/${getClass().simpleName}/${dateString}")
+ testFolder.mkdirs()
+ project = (DefaultProject) ProjectBuilder.builder().withProjectDir(testFolder).build()
+ project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
+ }
+
+ @Test
+ void "should apply java plugin"() {
+ expect:
+ project.plugins.hasPlugin(JavaPlugin)
+ }
+
+ @Test
+ void "should create contracts extension"() {
+ expect:
+ assert project.extensions.findByType(ContractVerifierExtension) != null
+ }
+
+ @Test
+ void "should create a test sourceset with java sources"() {
+ given:
+ ContractVerifierExtension extension = project.extensions.getByType(ContractVerifierExtension)
+ Directory projectDir = project.layout.projectDirectory
+ SourceSet contractTest = project.convention.getPlugin(JavaPluginConvention).getSourceSets().getByName("contractTest")
+
+ expect:
+ assert contractTest != null
+ assert contractTest.java.srcDirs.contains(projectDir.dir("src/contractTest/java").asFile)
+ assert contractTest.java.srcDirs.contains(extension.generatedTestJavaSourcesDir.get().asFile)
+ assert contractTest.resources.srcDirs.contains(projectDir.dir("src/contractTest/resources").asFile)
+ assert contractTest.resources.srcDirs.contains(extension.generatedTestResourcesDir.get().asFile)
+ }
+
+ @Test
+ void "should create a test sourceset with groovy sources, if the groovy plugin is present"() {
+ given:
+ project.plugins.apply(GroovyPlugin)
+ ContractVerifierExtension extension = project.extensions.getByType(ContractVerifierExtension)
+ Directory projectDir = project.layout.projectDirectory
+ SourceSet contractTest = project.convention.getPlugin(JavaPluginConvention).getSourceSets().getByName("contractTest")
+
+ expect:
+ assert contractTest != null
+ assert contractTest.java.srcDirs.contains(projectDir.dir("src/contractTest/java").asFile)
+ assert contractTest.java.srcDirs.contains(extension.generatedTestJavaSourcesDir.get().asFile)
+ assert contractTest.groovy.srcDirs.contains(projectDir.dir('src/contractTest/groovy').asFile)
+ assert contractTest.groovy.srcDirs.contains(extension.generatedTestGroovySourcesDir.get().asFile)
+ assert contractTest.resources.srcDirs.contains(projectDir.dir("src/contractTest/resources").asFile)
+ assert contractTest.resources.srcDirs.contains(extension.generatedTestResourcesDir.get().asFile)
+ }
+
+ @Test
+ void "should setup dependency configurations"() {
+ given:
+ Configuration contractTestCompileOnly = project.configurations.contractTestCompileOnly
+ Configuration contractTestImplementation = project.configurations.contractTestImplementation
+ Configuration contractTestRuntimeOnly = project.configurations.contractTestRuntimeOnly
+
+ expect:
+ assert contractTestCompileOnly != null
+ assert contractTestCompileOnly.extendsFrom.contains(project.configurations.testCompileOnly)
+ assert contractTestImplementation != null
+ assert contractTestImplementation.extendsFrom.contains(project.configurations.testImplementation)
+ assert contractTestRuntimeOnly != null
+ assert contractTestRuntimeOnly.extendsFrom.contains(project.configurations.testRuntimeOnly)
+ }
+
+ @Test
+ void "should create contract test task"() {
+ expect:
+ assert project.tasks.named("contractTest").get() != null
+ }
+
+ @Test
+ void "should create generateContractTests task"() {
+ expect:
+ assert project.tasks.named("generateContractTests").get() != null
+ }
+
+ @Test
+ void "should configure generateContractTests task as a dependency of the compileContractTestJava task"() {
+ expect:
+ assert project.tasks.compileContractTestJava.getDependsOn().contains(project.tasks.named("generateContractTests"))
+ assert project.tasks.findByName("compileContractTestGroovy") == null
+ }
+
+ @Test
+ void "should configure generateContractTests task as a dependency of the compileContractTestGroovy task"() {
+ given:
+ project.plugins.apply(GroovyPlugin)
+
+ expect:
+ assert project.tasks.compileContractTestJava.getDependsOn().contains(project.tasks.named("generateContractTests"))
+ assert project.tasks.compileContractTestGroovy.getDependsOn().contains(project.tasks.named("generateContractTests"))
+ }
+
+ @Test
+ void "should create generateClientStubs task"() {
+ expect:
+ assert project.tasks.named("generateClientStubs").get() != null
+ }
+
+ @Test
+ void "should create verifierStubsJar task"() {
+ expect:
+ assert project.tasks.named("verifierStubsJar").get() != null
+ }
+
+ @Test
+ void "should configure generateClientStubs task as a dependency of the verifierStubsJar task"() {
+ expect:
+ project.tasks.verifierStubsJar.getDependsOn().contains(project.tasks.named("generateClientStubs"))
+ }
+
+ @Test
+ void "should configure generateClientStubs task as a dependency of the publishStubsToScm task"() {
+ expect:
+ assert project.tasks.publishStubsToScm.getDependsOn().contains(project.tasks.named("generateClientStubs"))
+ }
+
+ @Test
+ void "should create copyContracts task"() {
+ expect:
+ assert project.tasks.named("copyContracts").get() != null
+ }
+
+ @Test
+ void "should configure copyContracts task as a dependency of the verifierStubsJar task"() {
+ expect:
+ assert project.tasks.verifierStubsJar.getDependsOn().contains(project.tasks.named("generateClientStubs"))
+ }
+
+ @Test
+ void "should compile"() {
+ given:
+ project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
+ ContractVerifierExtension extension = project.getExtensions().findByType(ContractVerifierExtension)
+ extension.with {
+
+ // tag::package_with_base_classes[]
+ packageWithBaseClasses = 'com.example.base'
+ // end::package_with_base_classes[]
+
+ // tag::base_class_mappings[]
+ baseClassForTests = "com.example.FooBase"
+ baseClassMappings {
+ baseClassMapping('.*/com/.*', 'com.example.ComBase')
+ baseClassMapping('.*/bar/.*': 'com.example.BarBase')
+ }
+ // end::base_class_mappings[]
+ }
+ expect:
+ assert extension
+ }
+
+ @Test
+ void "should property merge scm repository settings for publishing stubs to scm"() {
+ given:
+ project.plugins.apply(SpringCloudContractVerifierGradlePlugin)
+ ContractVerifierExtension extension = project.extensions.findByType(ContractVerifierExtension)
+ PublishStubsToScmTask task = project.tasks.findByName(PublishStubsToScmTask.TASK_NAME)
+
+ when:
+ extension.contractRepository.with {
+ repositoryUrl = "https://git.example.com"
+ username = "username"
+ password = "password"
+ proxyHost = "host"
+ proxyPort = 8080
+ }
+
+ then:
+ assert task.contractRepository.repositoryUrl.get() == "https://git.example.com"
+ assert task.contractRepository.username.get() == "username"
+ assert task.contractRepository.password.get() == "password"
+ assert task.contractRepository.proxyHost.get() == "host"
+ assert task.contractRepository.proxyPort.get() == 8080
+
+ and:
+ extension.publishStubsToScm.contractRepository.with {
+ repositoryUrl = "https://git2.example.com"
+ username = "username2"
+ password = "password2"
+ proxyHost = "host2"
+ proxyPort = 8081
+ }
+
+ then:
+ assert task.contractRepository.repositoryUrl.get() == "https://git2.example.com"
+ assert task.contractRepository.username.get() == "username2"
+ assert task.contractRepository.password.get() == "password2"
+ assert task.contractRepository.proxyHost.get() == "host2"
+ assert task.contractRepository.proxyPort.get() == 8081
+ }
+}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ScenarioProjectKotlinSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ScenarioProjectKotlinSpec.groovy
deleted file mode 100644
index a58c556b76..0000000000
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ScenarioProjectKotlinSpec.groovy
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.plugin
-
-import org.gradle.testkit.runner.BuildResult
-import org.gradle.testkit.runner.TaskOutcome
-import spock.lang.Ignore
-import spock.lang.Stepwise
-
-@Ignore
-@Stepwise
-class ScenarioProjectKotlinSpec extends ContractVerifierKotlinIntegrationSpec {
-
- def setup() {
- setupForProject("functionalTest/scenarioProjectKotlin")
- runTasksSuccessfully('clean')
- //delete accidental output when previously importing SimpleBoot into Idea to tweak it
- }
-
- def "should pass basic flow for Spock"() {
- given:
- assert fileExists('build.gradle.kts')
- expect:
- runTasksSuccessfully(checkAndPublishToMavenLocal())
- jarContainsContractVerifierContracts('fraudDetectionService/build/libs')
- BuildResult result = run("check", "--info", "--stacktrace")
- result.task(":fraudDetectionService:check").outcome == TaskOutcome.UP_TO_DATE
- result.task(":loanApplicationService:check").outcome == TaskOutcome.UP_TO_DATE
- }
-
- def "should pass basic flow for JUnit"() {
- given:
- assert fileExists('build.gradle.kts')
- expect:
- switchToJunitTestFramework()
- runTasksSuccessfully(checkAndPublishToMavenLocal())
- jarContainsContractVerifierContracts('fraudDetectionService/build/libs')
- BuildResult result = run("check", "--info", "--stacktrace")
- result.task(":fraudDetectionService:check").outcome == TaskOutcome.UP_TO_DATE
- result.task(":loanApplicationService:check").outcome == TaskOutcome.UP_TO_DATE
- }
-
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ScenarioProjectSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ScenarioProjectSpec.groovy
deleted file mode 100755
index 0954bd224a..0000000000
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ScenarioProjectSpec.groovy
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.plugin
-
-import org.gradle.testkit.runner.BuildResult
-import org.gradle.testkit.runner.TaskOutcome
-import spock.lang.Ignore
-import spock.lang.Stepwise
-
-@Ignore
-@Stepwise
-class ScenarioProjectSpec extends ContractVerifierIntegrationSpec {
-
- def setup() {
- setupForProject("functionalTest/scenarioProject")
- runTasksSuccessfully('clean')
- //delete accidental output when previously importing SimpleBoot into Idea to tweak it
- }
-
- def "should pass basic flow for Spock"() {
- given:
- assert fileExists('build.gradle')
- expect:
- runTasksSuccessfully(checkAndPublishToMavenLocal())
- jarContainsContractVerifierContracts('fraudDetectionService/build/libs')
- BuildResult result = run("check", "--info", "--stacktrace")
- result.task(":fraudDetectionService:check").outcome == TaskOutcome.UP_TO_DATE
- result.task(":loanApplicationService:check").outcome == TaskOutcome.UP_TO_DATE
- }
-
- def "should pass basic flow for JUnit"() {
- given:
- assert fileExists('build.gradle')
- expect:
- switchToJunitTestFramework()
- emptySourceSet()
- runTasksSuccessfully(checkAndPublishToMavenLocal())
- jarContainsContractVerifierContracts('fraudDetectionService/build/libs')
- BuildResult result = run("check", "--info", "--stacktrace")
- result.task(":fraudDetectionService:check").outcome == TaskOutcome.UP_TO_DATE
- result.task(":loanApplicationService:check").outcome == TaskOutcome.UP_TO_DATE
- }
-
- def "should properly work with build cache"() {
- given:
- def gradleUserHomeDir = new File(testProjectDir, ".gradleUserHome")
- gradleUserHomeDir.mkdirs()
- String[] tasks = ["-g ${gradleUserHomeDir}", "clean", "check", "publishToMavenLocal", "--info", "--stacktrace", "--build-cache"]
- assert fileExists("build.gradle")
-
- expect:
- runTasksSuccessfully(tasks)
- jarContainsContractVerifierContracts('fraudDetectionService/build/libs')
- BuildResult result = run(tasks)
- result.task(":fraudDetectionService:copyContracts").outcome == TaskOutcome.FROM_CACHE
- result.task(":fraudDetectionService:generateContractTests").outcome == TaskOutcome.FROM_CACHE
- result.task(":fraudDetectionService:contractTest").outcome == TaskOutcome.FROM_CACHE
- result.task(":fraudDetectionService:generateClientStubs").outcome == TaskOutcome.FROM_CACHE
- result.task(":loanApplicationService:check").outcome == TaskOutcome.UP_TO_DATE
- }
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle
index 549b0fdb7a..d27deebff9 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle
@@ -12,8 +12,8 @@ apply plugin: 'spring-cloud-contract'
apply plugin: 'maven-publish'
group = 'org.springframework.cloud.testprojects'
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+sourceCompatibility = 17
+targetCompatibility = 17
ext {
restAssuredVersion = '3.0.7'
@@ -33,13 +33,13 @@ repositories {
dependencies {
implementation "org.springframework:spring-web"
implementation "org.springframework:spring-context-support"
- implementation "org.codehaus.groovy:groovy-all:${groovyVersion}"
+ implementation "org.apache.groovy:groovy-all:${groovyVersion}"
implementation 'com.jayway.jsonpath:json-path-assert:2.2.0'
testImplementation "com.github.tomakehurst:wiremock:${wiremockVersion}"
testImplementation "com.toomuchcoding.jsonassert:jsonassert:${jsonAssertVersion}"
testImplementation("org.spockframework:spock-spring:1.0-groovy-2.4") {
- exclude(group: 'org.codehaus.groovy')
+ exclude(group: 'org.apache.groovy')
}
testImplementation "io.restassured:rest-assured:$restAssuredVersion"
testImplementation "io.restassured:spring-mock-mvc:$restAssuredVersion"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
index ee96efec03..734f145262 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.30.1
+wiremockVersion=2.35.0
jsonAssertVersion=0.6.2
-verifierVersion=3.1.9-SNAPSHOT
+verifierVersion=4.0.5-SNAPSHOT
groovyVersion=2.4.17
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle
index b76a361a95..2dd0fd6870 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle
@@ -31,8 +31,8 @@ group = 'org.springframework.cloud.testprojects'
subprojects {
apply plugin: 'groovy'
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
+ sourceCompatibility = 17
+ targetCompatibility = 17
version = "1.0.0"
repositories {
@@ -44,9 +44,9 @@ subprojects {
}
dependencies {
- testImplementation "org.codehaus.groovy:groovy"
+ testImplementation "org.apache.groovy:groovy"
testImplementation("org.spockframework:spock-core:$spockVersion") {
- exclude(group: 'org.codehaus.groovy')
+ exclude(group: 'org.apache.groovy')
}
testImplementation "junit:junit:4.12"
testImplementation "com.github.tomakehurst:wiremock:${wiremockVersion}"
@@ -112,11 +112,12 @@ configure([project(':fraudDetectionService'), project(':loanApplicationService')
implementation("org.springframework.boot:spring-boot-starter-actuator")
testRuntime("org.spockframework:spock-spring:$spockVersion") {
- exclude(group: 'org.codehaus.groovy')
+ exclude(group: 'org.apache.groovy')
}
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework:spring-test"
testImplementation "org.springframework.boot:spring-boot-test"
+ testImplementation "org.springframework.cloud:spring-cloud-test-support"
testImplementation "io.rest-assured:rest-assured:$restAssuredVersion"
testImplementation "io.rest-assured:spring-mock-mvc:$restAssuredVersion"
}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
index 48aed4e518..b2ccf8aa58 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
@@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.30.1
+wiremockVersion=2.35.0
jsonAssertVersion=0.6.2
-verifierVersion=3.1.9-SNAPSHOT
-bootVersion=2.6.15
+verifierVersion=4.0.5-SNAPSHOT
+bootVersion=3.0.9
groovyVersion=2.4.17
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy
index 82772f7804..3a63ee1dff 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy
@@ -36,7 +36,7 @@ import org.springframework.test.context.ContextConfiguration
@Stepwise
class LoanApplicationServiceSpec extends Specification {
- public static int port = org.springframework.util.SocketUtils.findAvailableTcpPort()
+ public static int port = org.springframework.cloud.test.TestSocketUtils.findAvailableTcpPort()
@ClassRule
@Shared
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/build.gradle.kts b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/build.gradle.kts
index 193986266d..16c6709a36 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/build.gradle.kts
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/build.gradle.kts
@@ -53,7 +53,7 @@ subprojects {
}
dependencies {
- testCompile("org.codehaus.groovy:groovy")
+ testCompile("org.apache.groovy:groovy")
testCompile("org.spockframework:spock-core:$spockVersion")
testCompile("junit:junit:4.12")
testCompile("com.github.tomakehurst:wiremock:$wiremockVersion")
@@ -95,7 +95,7 @@ configure(listOf(project(":fraudDetectionService"), project(":loanApplicationSer
compile("org.springframework.boot:spring-boot-starter-actuator")
testRuntime("org.spockframework:spock-spring:$spockVersion") {
- exclude(group = "org.codehaus.groovy")
+ exclude(group = "org.apache.groovy")
}
testCompile("org.mockito:mockito-core")
testCompile("org.springframework:spring-test")
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/gradle.properties
index 48aed4e518..b2ccf8aa58 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/gradle.properties
@@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.30.1
+wiremockVersion=2.35.0
jsonAssertVersion=0.6.2
-verifierVersion=3.1.9-SNAPSHOT
-bootVersion=2.6.15
+verifierVersion=4.0.5-SNAPSHOT
+bootVersion=3.0.9
groovyVersion=2.4.17
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy
index 82772f7804..3a63ee1dff 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProjectKotlin/loanApplicationService/src/test/groovy/org/springframework/cloud/LoanApplicationServiceSpec.groovy
@@ -36,7 +36,7 @@ import org.springframework.test.context.ContextConfiguration
@Stepwise
class LoanApplicationServiceSpec extends Specification {
- public static int port = org.springframework.util.SocketUtils.findAvailableTcpPort()
+ public static int port = org.springframework.cloud.test.TestSocketUtils.findAvailableTcpPort()
@ClassRule
@Shared
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-portal-plugin/pom.xml b/spring-cloud-contract-tools/spring-cloud-contract-gradle-portal-plugin/pom.xml
index 074a0dc47c..12a347e584 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-portal-plugin/pom.xml
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-portal-plugin/pom.xml
@@ -6,7 +6,7 @@
org.springframework.cloud
spring-cloud-contract-tools
- 3.1.9-SNAPSHOT
+ 4.0.5-SNAPSHOT
..
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml b/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml
index 577d8480c3..a6b43c7b59 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml
+++ b/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml
@@ -7,12 +7,12 @@
org.springframework.cloud
spring-cloud-contract-tools
- 3.1.9-SNAPSHOT
+ 4.0.5-SNAPSHOT
..
- 3.2.5
+ 3.6
spring-cloud-contract-maven-plugin
@@ -38,29 +38,15 @@
4.2.5
4.3.0
3.9.1
- 2.0.0
3.3.0
1.1
- 1.7.36
+ 2.0.7
2016
-
- org.codehaus.plexus
- plexus-component-metadata
- ${plexus-component-metadata.version}
-
-
-
- generate-metadata
- generate-test-metadata
-
-
-
-
org.apache.maven.plugins
maven-surefire-plugin
@@ -430,11 +416,6 @@
assertj-core
test