-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Make CI/CD integration of Maven Plugin easier #1412
Comments
I have discovered with Maven that you can use system properties in your POM file: https://maven.apache.org/pom.html#properties So you could use something like:
|
Yes this does work, but only when the system properties are available during the evaluation of the POM. They are not evaluated, when the Plugin is executed and therefore you cannot use a system property, that was set in a previous plugin/phase. |
Pact-JVM has the ability to parse expressions, so if we can pass in |
Maybe your idea with expression parsing could be solved, with the fix for #1410 (changing the prefix and suffix of the expressions) |
You can now use <host>{{pact.host}}</host>
<port>{{pact.port}}</port> and that will look for the JVM system properties |
4.2.11 released |
Issue
The Pact Maven Plugin currently requires that the service, that the providers should be verified against, is available prior to starting the maven build/goal.
However, when you want to verify a new version on a build pipeline, you (usually) do not have an instance of that version which you can test against; it must be started right there and then.
This is hindered by the current implementation of the Maven Plugin, because
This issue is linked to this Slack Thread.
Expected behavior
The Pact Maven Plugins allows for easier integration of the necessary infrastructure (like the Gradle plugin).
Solutions
Possible solutions
IMO This issue can be fixed in three ways
My current workaround
I'm starting the required infrastructure via the
exec-maven-plugin
as testcontainers and make the dynamic host/port available as system properties.Then I add a
requestFilter
to each provider that uses theREQUEST_RESPONSE
verification type (i.e. REST APIs), where the request uri is changed to the previously set values.Both the infrastructure startup and the pact provider verification are done in the maven phase
post-integration-test
.This here is the crucial part for the workaround:
The text was updated successfully, but these errors were encountered: