{"action":"created","comment":{"url":"https://api.github.com/repos/apache/storm/pulls/comments/74005665","id":74005665,"diff_hunk":"@@ -0,0 +1,81 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.apache.storm.submit.dependency;\n+\n+import org.sonatype.aether.artifact.Artifact;\n+import org.sonatype.aether.graph.Dependency;\n+import org.sonatype.aether.graph.Exclusion;\n+import org.sonatype.aether.util.artifact.DefaultArtifact;\n+import org.sonatype.aether.util.artifact.JavaScopes;\n+\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.Collection;\n+import java.util.List;\n+\n+public class AetherUtils {\n+    private AetherUtils() {\n+    }\n+\n+    public static Dependency parseDependency(String dependency) {\n+        List<String> dependencyAndExclusions = Arrays.asList(dependency.split(\"!\"));\n+        Collection<Exclusion> exclusions = new ArrayList<>();\n+        for (int idx = 1 ; idx < dependencyAndExclusions.size() ; idx++) {\n+            exclusions.add(AetherUtils.createExclusion(dependencyAndExclusions.get(idx)));\n+        }\n+\n+        Artifact artifact = new DefaultArtifact(dependencyAndExclusions.get(0));\n+        return new Dependency(artifact, JavaScopes.COMPILE, false, exclusions);\n+    }\n+\n+    public static Exclusion createExclusion(String exclusionString) {\n+        String[] parts = exclusionString.split(\":\");\n+\n+        // length of parts should be greater than 0\n+        String groupId = parts[0];\n+\n+        String artifactId = \"*\";\n+        String classifier = \"*\";\n+        String extension = \"*\";\n+\n+        int len = parts.length;\n+        if (len > 1) {\n+            artifactId = parts[1];\n+        }\n+        if (len > 2) {\n+            classifier = parts[2];\n+        }\n+        if (len > 3) {\n+            extension = parts[3];\n+        }\n+\n+        return new Exclusion(groupId, artifactId, classifier, extension);\n+    }\n+\n+    public static String artifactToString(Artifact artifact) {\n+        StringBuilder buffer = new StringBuilder(128);\n+        buffer.append(artifact.getGroupId());\n+        buffer.append(':').append(artifact.getArtifactId());\n+        buffer.append(':').append(artifact.getExtension());\n+        if(artifact.getClassifier().length() > 0) {","path":"external/storm-submit/src/main/java/org/apache/storm/submit/dependency/AetherUtils.java","position":75,"original_position":75,"commit_id":"dd495a318d87f18e994c52d89612c6e5e553438d","original_commit_id":"dd495a318d87f18e994c52d89612c6e5e553438d","user":{"login":"HeartSaVioR","id":1317309,"avatar_url":"https://avatars.githubusercontent.com/u/1317309?v=3","gravatar_id":"","url":"https://api.github.com/users/HeartSaVioR","html_url":"https://github.com/HeartSaVioR","followers_url":"https://api.github.com/users/HeartSaVioR/followers","following_url":"https://api.github.com/users/HeartSaVioR/following{/other_user}","gists_url":"https://api.github.com/users/HeartSaVioR/gists{/gist_id}","starred_url":"https://api.github.com/users/HeartSaVioR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeartSaVioR/subscriptions","organizations_url":"https://api.github.com/users/HeartSaVioR/orgs","repos_url":"https://api.github.com/users/HeartSaVioR/repos","events_url":"https://api.github.com/users/HeartSaVioR/events{/privacy}","received_events_url":"https://api.github.com/users/HeartSaVioR/received_events","type":"User","site_admin":false},"body":"OK will address.","created_at":"2016-08-09T06:48:49Z","updated_at":"2016-08-09T06:48:49Z","html_url":"https://github.com/apache/storm/pull/1608#discussion_r74005665","pull_request_url":"https://api.github.com/repos/apache/storm/pulls/1608","_links":{"self":{"href":"https://api.github.com/repos/apache/storm/pulls/comments/74005665"},"html":{"href":"https://github.com/apache/storm/pull/1608#discussion_r74005665"},"pull_request":{"href":"https://api.github.com/repos/apache/storm/pulls/1608"}}},"pull_request":{"url":"https://api.github.com/repos/apache/storm/pulls/1608","id":80187428,"html_url":"https://github.com/apache/storm/pull/1608","diff_url":"https://github.com/apache/storm/pull/1608.diff","patch_url":"https://github.com/apache/storm/pull/1608.patch","issue_url":"https://api.github.com/repos/apache/storm/issues/1608","number":1608,"state":"open","locked":false,"title":"STORM-2016 Topology submission improvement: support adding local jars and maven artifacts on submission (1.x)","user":{"login":"HeartSaVioR","id":1317309,"avatar_url":"https://avatars.githubusercontent.com/u/1317309?v=3","gravatar_id":"","url":"https://api.github.com/users/HeartSaVioR","html_url":"https://github.com/HeartSaVioR","followers_url":"https://api.github.com/users/HeartSaVioR/followers","following_url":"https://api.github.com/users/HeartSaVioR/following{/other_user}","gists_url":"https://api.github.com/users/HeartSaVioR/gists{/gist_id}","starred_url":"https://api.github.com/users/HeartSaVioR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeartSaVioR/subscriptions","organizations_url":"https://api.github.com/users/HeartSaVioR/orgs","repos_url":"https://api.github.com/users/HeartSaVioR/repos","events_url":"https://api.github.com/users/HeartSaVioR/events{/privacy}","received_events_url":"https://api.github.com/users/HeartSaVioR/received_events","type":"User","site_admin":false},"body":"* JIRA issue: http://issues.apache.org/jira/browse/STORM-2016\r\n* design doc: https://cwiki.apache.org/confluence/display/STORM/A.+Design+doc%3A+adding+jars+and+maven+artifacts+at+submission\r\n* discussion thread: http://mail-archives.apache.org/mod_mbox/storm-dev/201608.mbox/%3CCAF5108i9+tJaNZ0LgRkTMkVQEL7F+53k9uyzxcT6zhSU6OHx9Q@mail.gmail.com%3E\r\n\r\n----\r\n\r\n* bin/storm now supports \"--jars\" and \"--packages\" options\r\n  * it's only effective with \"storm jar\" and \"storm sql\"\r\n* introduce new module: storm-submit to help resolving dependencies with handling transitive dependencies\r\n* StormSubmitter will upload dependencies to BlobStore when submitting topology\r\n* Supervisor will download dependencies from BlobStore when such topology is assigned\r\n* Supervisor will launch workers with adding downloaded dependencies to worker classpath\r\n\r\nTODO\r\n\r\n- [x] documentation\r\n- [ ] craft pull request against master branch\r\n\r\nBtw, it might be better to place some modules out of external since 'external' has most of non storm-core modules and flux, sql, storm-submit, storm-kafka-monitor are not kind of connectors.","created_at":"2016-08-05T04:29:51Z","updated_at":"2016-08-09T06:48:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ecaa49f304f28780143957a4130a234e04799151","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/storm/pulls/1608/commits","review_comments_url":"https://api.github.com/repos/apache/storm/pulls/1608/comments","review_comment_url":"https://api.github.com/repos/apache/storm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/storm/issues/1608/comments","statuses_url":"https://api.github.com/repos/apache/storm/statuses/dd495a318d87f18e994c52d89612c6e5e553438d","head":{"label":"HeartSaVioR:STORM-2016-1.x","ref":"STORM-2016-1.x","sha":"dd495a318d87f18e994c52d89612c6e5e553438d","user":{"login":"HeartSaVioR","id":1317309,"avatar_url":"https://avatars.githubusercontent.com/u/1317309?v=3","gravatar_id":"","url":"https://api.github.com/users/HeartSaVioR","html_url":"https://github.com/HeartSaVioR","followers_url":"https://api.github.com/users/HeartSaVioR/followers","following_url":"https://api.github.com/users/HeartSaVioR/following{/other_user}","gists_url":"https://api.github.com/users/HeartSaVioR/gists{/gist_id}","starred_url":"https://api.github.com/users/HeartSaVioR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeartSaVioR/subscriptions","organizations_url":"https://api.github.com/users/HeartSaVioR/orgs","repos_url":"https://api.github.com/users/HeartSaVioR/repos","events_url":"https://api.github.com/users/HeartSaVioR/events{/privacy}","received_events_url":"https://api.github.com/users/HeartSaVioR/received_events","type":"User","site_admin":false},"repo":{"id":24730103,"name":"storm","full_name":"HeartSaVioR/storm","owner":{"login":"HeartSaVioR","id":1317309,"avatar_url":"https://avatars.githubusercontent.com/u/1317309?v=3","gravatar_id":"","url":"https://api.github.com/users/HeartSaVioR","html_url":"https://github.com/HeartSaVioR","followers_url":"https://api.github.com/users/HeartSaVioR/followers","following_url":"https://api.github.com/users/HeartSaVioR/following{/other_user}","gists_url":"https://api.github.com/users/HeartSaVioR/gists{/gist_id}","starred_url":"https://api.github.com/users/HeartSaVioR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeartSaVioR/subscriptions","organizations_url":"https://api.github.com/users/HeartSaVioR/orgs","repos_url":"https://api.github.com/users/HeartSaVioR/repos","events_url":"https://api.github.com/users/HeartSaVioR/events{/privacy}","received_events_url":"https://api.github.com/users/HeartSaVioR/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HeartSaVioR/storm","description":"Mirror of Apache Storm","fork":true,"url":"https://api.github.com/repos/HeartSaVioR/storm","forks_url":"https://api.github.com/repos/HeartSaVioR/storm/forks","keys_url":"https://api.github.com/repos/HeartSaVioR/storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HeartSaVioR/storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HeartSaVioR/storm/teams","hooks_url":"https://api.github.com/repos/HeartSaVioR/storm/hooks","issue_events_url":"https://api.github.com/repos/HeartSaVioR/storm/issues/events{/number}","events_url":"https://api.github.com/repos/HeartSaVioR/storm/events","assignees_url":"https://api.github.com/repos/HeartSaVioR/storm/assignees{/user}","branches_url":"https://api.github.com/repos/HeartSaVioR/storm/branches{/branch}","tags_url":"https://api.github.com/repos/HeartSaVioR/storm/tags","blobs_url":"https://api.github.com/repos/HeartSaVioR/storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HeartSaVioR/storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HeartSaVioR/storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/HeartSaVioR/storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HeartSaVioR/storm/statuses/{sha}","languages_url":"https://api.github.com/repos/HeartSaVioR/storm/languages","stargazers_url":"https://api.github.com/repos/HeartSaVioR/storm/stargazers","contributors_url":"https://api.github.com/repos/HeartSaVioR/storm/contributors","subscribers_url":"https://api.github.com/repos/HeartSaVioR/storm/subscribers","subscription_url":"https://api.github.com/repos/HeartSaVioR/storm/subscription","commits_url":"https://api.github.com/repos/HeartSaVioR/storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/HeartSaVioR/storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/HeartSaVioR/storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/HeartSaVioR/storm/issues/comments{/number}","contents_url":"https://api.github.com/repos/HeartSaVioR/storm/contents/{+path}","compare_url":"https://api.github.com/repos/HeartSaVioR/storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HeartSaVioR/storm/merges","archive_url":"https://api.github.com/repos/HeartSaVioR/storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HeartSaVioR/storm/downloads","issues_url":"https://api.github.com/repos/HeartSaVioR/storm/issues{/number}","pulls_url":"https://api.github.com/repos/HeartSaVioR/storm/pulls{/number}","milestones_url":"https://api.github.com/repos/HeartSaVioR/storm/milestones{/number}","notifications_url":"https://api.github.com/repos/HeartSaVioR/storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HeartSaVioR/storm/labels{/name}","releases_url":"https://api.github.com/repos/HeartSaVioR/storm/releases{/id}","deployments_url":"https://api.github.com/repos/HeartSaVioR/storm/deployments","created_at":"2014-10-02T18:00:01Z","updated_at":"2016-01-13T23:55:58Z","pushed_at":"2016-08-09T01:31:55Z","git_url":"git://github.com/HeartSaVioR/storm.git","ssh_url":"git@github.com:HeartSaVioR/storm.git","clone_url":"https://github.com/HeartSaVioR/storm.git","svn_url":"https://github.com/HeartSaVioR/storm","homepage":null,"size":106517,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:1.x-branch","ref":"1.x-branch","sha":"0253657f6ea4997cc9af95c428ad2b171fa13390","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":14135470,"name":"storm","full_name":"apache/storm","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/storm","description":"Mirror of Apache Storm","fork":false,"url":"https://api.github.com/repos/apache/storm","forks_url":"https://api.github.com/repos/apache/storm/forks","keys_url":"https://api.github.com/repos/apache/storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/storm/teams","hooks_url":"https://api.github.com/repos/apache/storm/hooks","issue_events_url":"https://api.github.com/repos/apache/storm/issues/events{/number}","events_url":"https://api.github.com/repos/apache/storm/events","assignees_url":"https://api.github.com/repos/apache/storm/assignees{/user}","branches_url":"https://api.github.com/repos/apache/storm/branches{/branch}","tags_url":"https://api.github.com/repos/apache/storm/tags","blobs_url":"https://api.github.com/repos/apache/storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/storm/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/storm/languages","stargazers_url":"https://api.github.com/repos/apache/storm/stargazers","contributors_url":"https://api.github.com/repos/apache/storm/contributors","subscribers_url":"https://api.github.com/repos/apache/storm/subscribers","subscription_url":"https://api.github.com/repos/apache/storm/subscription","commits_url":"https://api.github.com/repos/apache/storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/storm/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/storm/contents/{+path}","compare_url":"https://api.github.com/repos/apache/storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/storm/merges","archive_url":"https://api.github.com/repos/apache/storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/storm/downloads","issues_url":"https://api.github.com/repos/apache/storm/issues{/number}","pulls_url":"https://api.github.com/repos/apache/storm/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/storm/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/storm/labels{/name}","releases_url":"https://api.github.com/repos/apache/storm/releases{/id}","deployments_url":"https://api.github.com/repos/apache/storm/deployments","created_at":"2013-11-05T08:00:14Z","updated_at":"2016-08-09T05:47:18Z","pushed_at":"2016-08-09T05:41:47Z","git_url":"git://github.com/apache/storm.git","ssh_url":"git@github.com:apache/storm.git","clone_url":"https://github.com/apache/storm.git","svn_url":"https://github.com/apache/storm","homepage":null,"size":172949,"stargazers_count":3431,"watchers_count":3431,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2542,"mirror_url":"git://git.apache.org/storm.git","open_issues_count":140,"forks":2542,"open_issues":140,"watchers":3431,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/storm/pulls/1608"},"html":{"href":"https://github.com/apache/storm/pull/1608"},"issue":{"href":"https://api.github.com/repos/apache/storm/issues/1608"},"comments":{"href":"https://api.github.com/repos/apache/storm/issues/1608/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/storm/pulls/1608/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/storm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/storm/pulls/1608/commits"},"statuses":{"href":"https://api.github.com/repos/apache/storm/statuses/dd495a318d87f18e994c52d89612c6e5e553438d"}}}}
{"actor":{"display_login":"HeartSaVioR"}}