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
Use Spring CLI to run stubs locally #37
Comments
Currently you can run stubs using maven, even if you don't have pom.xml:
|
It would be really awesome also to use |
@jkubrynski when I run "mvn spring-cloud-contract-verifier:run -Dstubs="groupid.a.b.c"" under such folder where there is no pom.xml and no contracts. Although the goal is successful, I found such log "Launching StubRunner with contracts from c:\empty_folder" and "Started stub server for project **** on port -1". as you see the port is -1, I can't access the stub runner via -1 port. Could you give me some suggestion to run stub runner via mvn? |
Can you show how your contracts look like? |
@marcingrzejszczak Does it mean it is necessary to run "mvn spring-cloud-contract-verifier:run " under such folder it has to contain contracts?The folder to run "mvn spring-cloud-contract-verifier:run " has no contracts. I want to run "mvn spring-cloud-contract-verifier:run" under non-jvm project to run stub runner in advance. and then no-jvm project can send message to stub runner. My contracts are saved on one common repository. Once commit is pushed to the common repository, ***.jar and ***-stub.jar will be upload to remote maven repository. |
@simonzhong1985 it's exactly how it works but you need to use a different property. As documented here you should pass |
@jkubrynski thanks for your answer. It works, Now I can download stubs by -Dspring.cloud.contract.verifier.stubs=com.aaa:bb. However, It does not work by -Dspring.cloud.contract.verifier.http.port to run wiremock on assigned port. Note: I used Spring Cloud Contract Plugin 1.1.1-Release. |
You should pass the port in the ids |
@marcingrzejszczak thanks. It works as I expect. Thanks again. |
@marcingrzejszczak Is there any update about using spring cli to run stub? |
Yeah, thanks for trying it out. Thanks to you, we've got these things that popped up - #340 and #341 As for the update - I haven't done any work on the spring cli. Come to think of it maybe we should stick to maven since we already have some implementation there. It's easier to download and install maven instead of installing spring cli + the cloud extension. |
I think we should add the Stub Runner application to the Spring Cloud CLI project. The rest should be done via Maven |
Done via spring-cloud/spring-cloud-cli#65 |
Hi @marcingrzejszczak @jkubrynski , In a directory which does not have any pom.xml file I am facing the issue of the plugin. No plugin found for prefix 'spring-cloud-contract-verifier' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/gurushantha.rg/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1] |
For the case where the consumer wants to prototype the API it would be good for them to immediately install and run stubs from the contracts.
E.g. installing
E.g. running
The text was updated successfully, but these errors were encountered: