{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/584","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/584/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/584/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/584/events","html_url":"https://github.com/spring-cloud/spring-cloud-contract/issues/584","id":306523685,"number":584,"title":"Messaging contracts per topic support in spring-cloud-contract-maven-plugin","user":{"login":"anikitchuk","id":7498227,"avatar_url":"https://avatars2.githubusercontent.com/u/7498227?v=4","gravatar_id":"","url":"https://api.github.com/users/anikitchuk","html_url":"https://github.com/anikitchuk","followers_url":"https://api.github.com/users/anikitchuk/followers","following_url":"https://api.github.com/users/anikitchuk/following{/other_user}","gists_url":"https://api.github.com/users/anikitchuk/gists{/gist_id}","starred_url":"https://api.github.com/users/anikitchuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anikitchuk/subscriptions","organizations_url":"https://api.github.com/users/anikitchuk/orgs","repos_url":"https://api.github.com/users/anikitchuk/repos","events_url":"https://api.github.com/users/anikitchuk/events{/privacy}","received_events_url":"https://api.github.com/users/anikitchuk/received_events","type":"User","site_admin":false},"labels":[{"id":391541032,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":449817170,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-03-19T15:57:45Z","updated_at":"2018-05-10T13:09:36Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Each producer that supports [messaging contracts per topic](https://github.com/spring-cloud/spring-cloud-contract/blob/master/docs/src/main/asciidoc/verifier_faq.adoc#how-can-i-define-messaging-contracts-per-topic-not-per-producer) needs to duplicate the part of the logic in its pom that is probably could be hidden inside spring-cloud-contract-maven-plugin, especially downloading and unpacking the jar with contracts from common repo by maven-dependency-plugin: \r\n\r\n```\r\n<plugin>\r\n   <groupId>org.apache.maven.plugins</groupId>\r\n   <artifactId>maven-dependency-plugin</artifactId>\r\n   <version>3.0.0</version>\r\n   <executions>\r\n      <execution>\r\n         <id>unpack-dependencies</id>\r\n         <phase>process-resources</phase>\r\n         <goals>\r\n            <goal>unpack</goal>\r\n         </goals>\r\n         <configuration>\r\n            <artifactItems>\r\n               <artifactItem>\r\n                  <groupId>com.example</groupId>\r\n                  <artifactId>common-repo</artifactId>\r\n                  <type>jar</type>\r\n                  <overWrite>false</overWrite>\r\n                  <outputDirectory>${project.build.directory}/contracts</outputDirectory>\r\n               </artifactItem>\r\n            </artifactItems>\r\n         </configuration>\r\n      </execution>\r\n   </executions>\r\n</plugin>\r\n```\r\n\r\nand deleting unused contracts by maven-antrun-plugin: \r\n```\r\n<plugin>\r\n   <groupId>org.apache.maven.plugins</groupId>\r\n   <artifactId>maven-antrun-plugin</artifactId>\r\n   <version>1.8</version>\r\n   <executions>\r\n      <execution>\r\n         <phase>process-resources</phase>\r\n         <goals>\r\n            <goal>run</goal>\r\n         </goals>\r\n         <configuration>\r\n            <tasks>\r\n               <delete includeemptydirs=\"true\">\r\n                  <fileset dir=\"${project.build.directory}/contracts\">\r\n                     <include name=\"**/*\" />\r\n                     <!--Producer artifactId-->\r\n                     <exclude name=\"**/${project.artifactId}/**\" />\r\n                     <!--List of the supported topics-->\r\n                     <exclude name=\"**/${first-topic}/**\" />\r\n                     <exclude name=\"**/${second-topic}/**\" />\r\n                  </fileset>\r\n               </delete>\r\n            </tasks>\r\n         </configuration>\r\n      </execution>\r\n   </executions>\r\n</plugin>\r\n```\r\nSo could the spring-cloud-contract-maven-plugin be extended to support the above logic? \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/comments/388048428","html_url":"https://github.com/spring-cloud/spring-cloud-contract/issues/584#issuecomment-388048428","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/584","id":388048428,"user":{"login":"TYsewyn","id":6283320,"avatar_url":"https://avatars0.githubusercontent.com/u/6283320?v=4","gravatar_id":"","url":"https://api.github.com/users/TYsewyn","html_url":"https://github.com/TYsewyn","followers_url":"https://api.github.com/users/TYsewyn/followers","following_url":"https://api.github.com/users/TYsewyn/following{/other_user}","gists_url":"https://api.github.com/users/TYsewyn/gists{/gist_id}","starred_url":"https://api.github.com/users/TYsewyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TYsewyn/subscriptions","organizations_url":"https://api.github.com/users/TYsewyn/orgs","repos_url":"https://api.github.com/users/TYsewyn/repos","events_url":"https://api.github.com/users/TYsewyn/events{/privacy}","received_events_url":"https://api.github.com/users/TYsewyn/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T13:09:36Z","updated_at":"2018-05-10T13:09:36Z","author_association":"CONTRIBUTOR","body":"Honestly I think it makes more sense to provide an exclusion pattern rather than an inclusion pattern.\r\nThat way it works in the same way like before when we deleted unused contracts using the maven-antrun-plugin.\r\nIt also gives a more natural feel to the setup: once you have an agreement your application should always be validated upon that agreement.\r\nNext to that, I also think people are going to make less errors with this setup.\r\nIf you forgot to exclude a contract by accident then you'll definitely notice it when your build fails.\r\nIn your proposal you won't notice anything unless it's too late when you accidentally forgot to include a contract.\r\nWDYT @anikitchuk, @vasilievip, @marcingrzejszczak?"}}
{"actor":{"display_login":"TYsewyn"}}