pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

add ignore option for pact-jvm can-i-deploy #1444

Closed bawoodruff closed 7 months ago

bawoodruff commented 3 years ago

The pact-broker CLI offers this ignore option -- I would like to filter providers through a similar mechanism with the pact-jvm maven plugin:

      [--ignore=IGNORE]                    
              # The pacticipant name to ignore. Use once for each pacticipant
                being ignored. A specific version can be ignored by also
                specifying a --version after the pacticipant name option.
uglyog commented 3 years ago

I've added the ignore options, but I'm unsure how Maven will map system properties to a repeated Mojo parameter. I assume it will be something like -Dignore.name=one -Dignore.version=123 -Dignore.name=two. You'll need to play around with them to work that out.

uglyog commented 3 years ago

No, that doesn't work

uglyog commented 3 years ago

Maven only supports comma separated values for system properties mapped to collections. I managed to get pact:can-i-deploy -Dpacticipant='Animal Profile Service' -Dlatest=true -Dignore=bob:100,fred to set ignore = [IgnoreSelector(name=bob, version=100), IgnoreSelector(name=fred, version=null)]

I'll update the docs with the format required for that parameter.

uglyog commented 3 years ago

4.1.28/4.2.13 is released