{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/38507356","id":38507356,"diff_hunk":"@@ -171,7 +171,6 @@\n \n     <modules>\n         <module>fully-loaded</module>","path":"distribution/pom.xml","position":3,"original_position":3,"commit_id":"3990ca2390f1e3d6cc28e4af135e90ebf0c08ea3","original_commit_id":"3990ca2390f1e3d6cc28e4af135e90ebf0c08ea3","user":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"body":"Totally agree. At the end of the day, I really think that elasticsearch will be more a container of plugins and every single will be a plugin which can be or not packaged within the final distribution or available as a plugin. Like what Logstash is today.\r\n\r\nAbout optional deps, when embedding elasticsearch java client in an app, I had to add:\r\n\r\n```xml\r\n<dependency>\r\n            <groupId>org.apache.lucene</groupId>\r\n            <artifactId>lucene-expressions</artifactId>\r\n            <version>5.2.1</version>\r\n        </dependency>\r\n```\r\n\r\nOtherwise, the client complains about some missing parts...\r\n\r\nMay be this one should not be optional at the very least?","created_at":"2015-09-02T08:07:46Z","updated_at":"2015-09-02T08:07:46Z","html_url":"https://github.com/elastic/elasticsearch/pull/13252#discussion_r38507356","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/38507356"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/13252#discussion_r38507356"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252","id":43900231,"html_url":"https://github.com/elastic/elasticsearch/pull/13252","diff_url":"https://github.com/elastic/elasticsearch/pull/13252.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/13252.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/13252","number":13252,"state":"open","locked":false,"title":"[build] remove shaded elasticsearch version","user":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"body":"The shaded version of elasticsearch was built at the very beginning to avoid dependency conflicts in a specific case where:\r\n\r\n* People use elasticsearch from Java\r\n* People needs to embed elasticsearch jar within their own application (as it's today the only way to get a `TransportClient`)\r\n* People also embed in their application another (most of the time older) version of dependency we are using for elasticsearch, such as: Guava, Joda, Jackson...\r\n\r\nThis conflict issue can be solved within the projects themselves by either upgrade the dependency version and use the one provided by elasticsearch or by shading elasticsearch project and relocating some conflicting packages.\r\n\r\nExample\r\n-------\r\n\r\nAs an example, let's say you want to use within your project `Joda 2.1` but elasticsearch `2.0.0-beta1` provides `Joda 2.8`.\r\nLet's say you also want to run all that with shield plugin.\r\n\r\n### Create the shaded version\r\n\r\nCreate a new maven project or module with:\r\n\r\n```xml\r\n<groupId>fr.pilato.elasticsearch.test</groupId>\r\n<artifactId>es-shaded</artifactId>\r\n<version>1.0-SNAPSHOT</version>\r\n\r\n<properties>\r\n    <elasticsearch.version>2.0.0-beta1</elasticsearch.version>\r\n</properties>\r\n\r\n<dependencies>\r\n    <dependency>\r\n        <groupId>org.elasticsearch</groupId>\r\n        <artifactId>elasticsearch</artifactId>\r\n        <version>${elasticsearch.version}</version>\r\n    </dependency>\r\n    <dependency>\r\n        <groupId>org.elasticsearch.plugin</groupId>\r\n        <artifactId>shield</artifactId>\r\n        <version>${elasticsearch.version}</version>\r\n    </dependency>\r\n</dependencies>\r\n\r\n<repositories>\r\n    <repository>\r\n        <id>elasticsearch-releases</id>\r\n        <url>http://maven.elasticsearch.org/releases</url>\r\n        <releases>\r\n            <enabled>true</enabled>\r\n            <updatePolicy>daily</updatePolicy>\r\n        </releases>\r\n        <snapshots>\r\n            <enabled>false</enabled>\r\n        </snapshots>\r\n    </repository>\r\n</repositories>\r\n```\r\n\r\nAnd now shade and relocate all packages which conflicts with your own application:\r\n\r\n```xml\r\n<build>\r\n    <plugins>\r\n        <plugin>\r\n            <groupId>org.apache.maven.plugins</groupId>\r\n            <artifactId>maven-shade-plugin</artifactId>\r\n            <version>2.4.1</version>\r\n            <executions>\r\n                <execution>\r\n                    <phase>package</phase>\r\n                    <goals>\r\n                        <goal>shade</goal>\r\n                    </goals>\r\n                    <configuration>\r\n                        <relocations>\r\n                            <relocation>\r\n                                <pattern>org.joda</pattern>\r\n                                <shadedPattern>fr.pilato.thirdparty.joda</shadedPattern>\r\n                            </relocation>\r\n                        </relocations>\r\n                    </configuration>\r\n                </execution>\r\n            </executions>\r\n        </plugin>\r\n    </plugins>\r\n</build>\r\n```\r\n\r\nYou can create now a shaded version of elasticsearch + shield by running `mvn clean install`.\r\n\r\n### Embed this jar within your application\r\n\r\nIn your project, you can now depend on:\r\n\r\n```xml\r\n<dependency>\r\n    <groupId>fr.pilato.elasticsearch.test</groupId>\r\n    <artifactId>es-shaded</artifactId>\r\n    <version>1.0-SNAPSHOT</version>\r\n</dependency>\r\n<dependency>\r\n    <groupId>org.apache.lucene</groupId>\r\n    <artifactId>lucene-expressions</artifactId>\r\n    <version>5.2.1</version>\r\n</dependency>\r\n<dependency>\r\n    <groupId>joda-time</groupId>\r\n    <artifactId>joda-time</artifactId>\r\n    <version>2.1</version>\r\n</dependency>\r\n```\r\n\r\nBuild then your TransportClient as usual:\r\n\r\n```java\r\nTransportClient client = TransportClient.builder()\r\n        .settings(Settings.builder()\r\n                        .put(\"path.home\", \".\")\r\n                        .put(\"shield.user\", \"username:password\")\r\n                        .put(\"plugin.types\", \"org.elasticsearch.shield.ShieldPlugin\")\r\n        )\r\n        .build();\r\nclient.addTransportAddress(new InetSocketTransportAddress(new InetSocketAddress(\"localhost\", 9300)));\r\n\r\n// Index some data\r\nclient.prepareIndex(\"test\", \"doc\", \"1\").setSource(\"foo\", \"bar\").setRefresh(true).get();\r\nSearchResponse searchResponse = client.prepareSearch(\"test\").get();\r\n```\r\n\r\nIf you want to use your own version of Joda, then import for example `org.joda.time.DateTime`. If you want to access to the shaded version (not recommended though), import `fr.pilato.thirdparty.joda.time.DateTime`.\r\n\r\nYou can run a simple test to make sure that both classes can live together within the same JVM:\r\n\r\n```java\r\nCodeSource codeSource = new org.joda.time.DateTime().getClass().getProtectionDomain().getCodeSource();\r\nSystem.out.println(\"unshaded = \" + codeSource);\r\n\r\ncodeSource = new fr.pilato.thirdparty.joda.time.DateTime().getClass().getProtectionDomain().getCodeSource();\r\nSystem.out.println(\"shaded = \" + codeSource);\r\n```\r\n\r\nIt will print:\r\n\r\n```\r\nunshaded = (file:/path/to/joda-time-2.1.jar <no signer certificates>)\r\nshaded = (file:/path/to/es-shaded-1.0-SNAPSHOT.jar <no signer certificates>)\r\n```\r\n\r\nBy the way, the project can now build with Maven 3.3.3 so we can relax a bit our maven policy.","created_at":"2015-09-01T16:58:00Z","updated_at":"2015-09-02T08:07:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc27e46ab83cd5de653e4c67fba9f2f0a31333e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/13252/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/3990ca2390f1e3d6cc28e4af135e90ebf0c08ea3","head":{"label":"dadoonet:pr/maven-shaded","ref":"pr/maven-shaded","sha":"3990ca2390f1e3d6cc28e4af135e90ebf0c08ea3","user":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"repo":{"id":2521491,"name":"elasticsearch","full_name":"dadoonet/elasticsearch","owner":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dadoonet/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/dadoonet/elasticsearch","forks_url":"https://api.github.com/repos/dadoonet/elasticsearch/forks","keys_url":"https://api.github.com/repos/dadoonet/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dadoonet/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dadoonet/elasticsearch/teams","hooks_url":"https://api.github.com/repos/dadoonet/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/dadoonet/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/dadoonet/elasticsearch/events","assignees_url":"https://api.github.com/repos/dadoonet/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/dadoonet/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/dadoonet/elasticsearch/tags","blobs_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dadoonet/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/dadoonet/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/dadoonet/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/dadoonet/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/dadoonet/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/dadoonet/elasticsearch/subscription","commits_url":"https://api.github.com/repos/dadoonet/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/dadoonet/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/dadoonet/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/dadoonet/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/dadoonet/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dadoonet/elasticsearch/merges","archive_url":"https://api.github.com/repos/dadoonet/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dadoonet/elasticsearch/downloads","issues_url":"https://api.github.com/repos/dadoonet/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/dadoonet/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/dadoonet/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/dadoonet/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dadoonet/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/dadoonet/elasticsearch/releases{/id}","created_at":"2011-10-05T19:24:28Z","updated_at":"2015-03-10T00:44:50Z","pushed_at":"2015-09-01T16:55:38Z","git_url":"git://github.com/dadoonet/elasticsearch.git","ssh_url":"git@github.com:dadoonet/elasticsearch.git","clone_url":"https://github.com/dadoonet/elasticsearch.git","svn_url":"https://github.com/dadoonet/elasticsearch","homepage":"http://elasticsearch.org","size":134963,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"7cbd0a1bf53081c66ace79b23cdeedfafaad34c6","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-09-02T06:58:20Z","pushed_at":"2015-09-02T08:05:42Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":414734,"stargazers_count":12570,"watchers_count":12570,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4055,"mirror_url":null,"open_issues_count":1193,"forks":4055,"open_issues":1193,"watchers":12570,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/13252"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/13252"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/13252/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/13252/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/3990ca2390f1e3d6cc28e4af135e90ebf0c08ea3"}}}}