Merge branch '2.1.x'
This commit is contained in:
@@ -82,7 +82,7 @@ class ContractsCopyTask extends DefaultTask {
|
||||
@TaskAction
|
||||
void sync() {
|
||||
File contractsDirectory = config.contractsDirectory.get().asFile
|
||||
String contractsRepository = config.contractsRepository
|
||||
String contractsRepository = config.contractsRepository.get()
|
||||
throwExceptionWhenFailOnNoContracts(contractsDirectory, contractsRepository)
|
||||
String antPattern = "${config.includedRootFolderAntPattern.get()}*.*"
|
||||
String slashSeparatedGroupId = project.group.toString().replace(".", File.separator)
|
||||
|
||||
@@ -47,6 +47,10 @@ public class GenerateStubsMojo extends AbstractMojo {
|
||||
required = true)
|
||||
private File projectBuildDirectory;
|
||||
|
||||
@Parameter(defaultValue = "${project.build.finalName}", readonly = true,
|
||||
required = true)
|
||||
private String projectFinalName;
|
||||
|
||||
@Parameter(property = "stubsDirectory",
|
||||
defaultValue = "${project.build.directory}/stubs")
|
||||
private File outputDirectory;
|
||||
@@ -112,9 +116,14 @@ public class GenerateStubsMojo extends AbstractMojo {
|
||||
stubsJarFile);
|
||||
}
|
||||
|
||||
private File createStubJar(File stubsOutputDir) throws MojoFailureException {
|
||||
String stubArchiveName = this.project.getBuild().getFinalName() + "-"
|
||||
+ this.classifier + ".jar";
|
||||
private File createStubJar(File stubsOutputDir)
|
||||
throws MojoFailureException, MojoExecutionException {
|
||||
if (!stubsOutputDir.exists()) {
|
||||
throw new MojoExecutionException("Stubs could not be found: ["
|
||||
+ stubsOutputDir.getAbsolutePath()
|
||||
+ "] .\nPlease make sure that spring-cloud-contract:convert was invoked");
|
||||
}
|
||||
String stubArchiveName = this.projectFinalName + "-" + this.classifier + ".jar";
|
||||
File stubsJarFile = new File(this.projectBuildDirectory, stubArchiveName);
|
||||
String[] excludes = excludes();
|
||||
getLog().info("Files matching this pattern will be excluded from "
|
||||
|
||||
@@ -148,7 +148,7 @@ public class PluginUnitTest {
|
||||
public void shouldGenerateStubs() throws Exception {
|
||||
File basedir = this.resources.getBasedir("generatedStubs");
|
||||
this.maven.executeMojo(basedir, "generateStubs", defaultPackageForTests());
|
||||
assertFilesPresent(basedir, "target/sample-project-0.1-stubs.jar");
|
||||
assertFilesPresent(basedir, "target/sample-project-stubs.jar");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -156,7 +156,7 @@ public class PluginUnitTest {
|
||||
File basedir = this.resources.getBasedir("generatedStubs");
|
||||
this.maven.executeMojo(basedir, "generateStubs", defaultPackageForTests(),
|
||||
newParameter("attachContracts", "false"));
|
||||
assertFilesPresent(basedir, "target/sample-project-0.1-stubs.jar");
|
||||
assertFilesPresent(basedir, "target/sample-project-stubs.jar");
|
||||
// FIXME: add assertion for jar content
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class PluginUnitTest {
|
||||
File basedir = this.resources.getBasedir("generatedStubs");
|
||||
this.maven.executeMojo(basedir, "generateStubs", defaultPackageForTests(),
|
||||
newParameter("classifier", "foo"));
|
||||
assertFilesPresent(basedir, "target/sample-project-0.1-foo.jar");
|
||||
assertFilesPresent(basedir, "target/sample-project-foo.jar");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<version>0.1</version>
|
||||
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
||||
@@ -19,12 +19,12 @@ package org.springframework.cloud.contract.verifier.config.framework;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @deprecated appropriate implementations of <code>org.springframework.cloud.contract.verifier.builder.Visitor</code>
|
||||
* should be used instead.
|
||||
* @deprecated appropriate implementations of
|
||||
* <code>org.springframework.cloud.contract.verifier.builder.Visitor</code> should be used
|
||||
* instead.
|
||||
*
|
||||
* Defines elements characteristic of a given test framework to be used during test class
|
||||
* construction.
|
||||
*
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @since 2.1.0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user