{"action":"created","issue":{"url":"https://api.github.com/repos/sergei-ivanov/maven-protoc-plugin/issues/22","labels_url":"https://api.github.com/repos/sergei-ivanov/maven-protoc-plugin/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/sergei-ivanov/maven-protoc-plugin/issues/22/comments","events_url":"https://api.github.com/repos/sergei-ivanov/maven-protoc-plugin/issues/22/events","html_url":"https://github.com/sergei-ivanov/maven-protoc-plugin/issues/22","id":50684994,"number":22,"title":"Any in src/test/proto cause all protos defined in /src/main/proto to be generated in generated-test-sources ","user":{"login":"ericzundel","id":119728,"avatar_url":"https://avatars.githubusercontent.com/u/119728?v=3","gravatar_id":"","url":"https://api.github.com/users/ericzundel","html_url":"https://github.com/ericzundel","followers_url":"https://api.github.com/users/ericzundel/followers","following_url":"https://api.github.com/users/ericzundel/following{/other_user}","gists_url":"https://api.github.com/users/ericzundel/gists{/gist_id}","starred_url":"https://api.github.com/users/ericzundel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericzundel/subscriptions","organizations_url":"https://api.github.com/users/ericzundel/orgs","repos_url":"https://api.github.com/users/ericzundel/repos","events_url":"https://api.github.com/users/ericzundel/events{/privacy}","received_events_url":"https://api.github.com/users/ericzundel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-12-02T17:19:14Z","updated_at":"2015-02-28T03:10:47Z","closed_at":"2015-02-28T02:39:44Z","body":"To replicate this issue, create a project with a .proto file in it:\r\n```\r\nsrc/main/proto/foo.proto\r\n```\r\n\r\nRun `mvn compile` and the generated java files go in `targets/generated-sources`.  So far so good.\r\n\r\nNow, rm -rf the target directory and put any file into the src/test/proto directory:\r\n\r\n```\r\nrm -rf target\r\ntouch src/test/proto/README.md\r\n```\r\n\r\nRe-run `mvn compile`.  The proto files are now all generated into `targets/generated-test-sources` and invisible outside of scope \"test\" to other projects.\r\n\r\nThe issue is that there is only one java output directory and if you set it twice using Protoc.setJavaOutputDirectory(), the last one wins.  We could patch around this issue by skipping the setJavaOutputDirectory() in  if there are no valid .proto source files inside of ProtocTestCompileMojo.addProtocBuilderParameters().  That will fix this case, but might allow you to define protos both in src/main/proto and src/test/proto in the same project.  \r\n"},"comment":{"url":"https://api.github.com/repos/sergei-ivanov/maven-protoc-plugin/issues/comments/76507322","html_url":"https://github.com/sergei-ivanov/maven-protoc-plugin/issues/22#issuecomment-76507322","issue_url":"https://api.github.com/repos/sergei-ivanov/maven-protoc-plugin/issues/22","id":76507322,"user":{"login":"ericzundel","id":119728,"avatar_url":"https://avatars.githubusercontent.com/u/119728?v=3","gravatar_id":"","url":"https://api.github.com/users/ericzundel","html_url":"https://github.com/ericzundel","followers_url":"https://api.github.com/users/ericzundel/followers","following_url":"https://api.github.com/users/ericzundel/following{/other_user}","gists_url":"https://api.github.com/users/ericzundel/gists{/gist_id}","starred_url":"https://api.github.com/users/ericzundel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericzundel/subscriptions","organizations_url":"https://api.github.com/users/ericzundel/orgs","repos_url":"https://api.github.com/users/ericzundel/repos","events_url":"https://api.github.com/users/ericzundel/events{/privacy}","received_events_url":"https://api.github.com/users/ericzundel/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T03:10:47Z","updated_at":"2015-02-28T03:10:47Z","body":"Thanks Sergei\n\nOn Fri, Feb 27, 2015, 9:39 PM Sergei Ivanov <notifications@github.com>\nwrote:\n\n> Eric,\n>\n> I am closing the issue, please reopen if you have got any further\n> questions.\n>\n> Kind regards,\n> Sergei\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/sergei-ivanov/maven-protoc-plugin/issues/22#issuecomment-76506053>\n> .\n>\n"}}