{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/comments/134095501","pull_request_review_id":57353823,"id":134095501,"diff_hunk":"@@ -0,0 +1,67 @@\n+/*\n+ * The MIT License\n+ *\n+ * Copyright (c) 2014, Diabol AB, Patrik Boström\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+package hudson.maven;\n+\n+import hudson.Extension;\n+import hudson.model.AbstractBuild;\n+import hudson.model.TaskListener;\n+import org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro;\n+import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException;\n+\n+import java.io.IOException;\n+import java.util.Map;\n+\n+@Extension(optional = true)\n+@SuppressWarnings(\"UnusedDeclaration\")\n+public class PomVersionTokenMacro extends DataBoundTokenMacro {\n+\n+    private static final String NAME = \"POM_VERSION\";\n+\n+    // Force a classloading error TokenMacro plugin isn't available\n+    @SuppressWarnings(\"UnusedDeclaration\")\n+    public static final Class clazz = DataBoundTokenMacro.class;\n+\n+\n+    @DataBoundTokenMacro.Parameter(required = false)\n+    public boolean stripSnapshot = false;\n+\n+    @Override\n+    public String evaluate(AbstractBuild<?, ?> context, TaskListener listener, String macroName) throws MacroEvaluationException, IOException, InterruptedException {\n+        Map<String, String> env = context.getEnvironment(listener);\n+        if (env.containsKey(NAME)) {\n+            if (stripSnapshot) {\n+                String version = env.get(NAME);\n+                return version.replace(\"-SNAPSHOT\", \"\");","path":"src/main/java/hudson/maven/PomVersionTokenMacro.java","position":55,"original_position":55,"commit_id":"ebff715728e9f738804239cad9b4f1fb782a87c0","original_commit_id":"ebff715728e9f738804239cad9b4f1fb782a87c0","user":{"login":"warden","id":521838,"avatar_url":"https://avatars3.githubusercontent.com/u/521838?v=4","gravatar_id":"","url":"https://api.github.com/users/warden","html_url":"https://github.com/warden","followers_url":"https://api.github.com/users/warden/followers","following_url":"https://api.github.com/users/warden/following{/other_user}","gists_url":"https://api.github.com/users/warden/gists{/gist_id}","starred_url":"https://api.github.com/users/warden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warden/subscriptions","organizations_url":"https://api.github.com/users/warden/orgs","repos_url":"https://api.github.com/users/warden/repos","events_url":"https://api.github.com/users/warden/events{/privacy}","received_events_url":"https://api.github.com/users/warden/received_events","type":"User","site_admin":false},"body":"It's replaced only when `stripSnapshot=true`","created_at":"2017-08-19T16:37:39Z","updated_at":"2017-08-19T16:37:39Z","html_url":"https://github.com/jenkinsci/maven-plugin/pull/47#discussion_r134095501","pull_request_url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/comments/134095501"},"html":{"href":"https://github.com/jenkinsci/maven-plugin/pull/47#discussion_r134095501"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47","id":38077692,"html_url":"https://github.com/jenkinsci/maven-plugin/pull/47","diff_url":"https://github.com/jenkinsci/maven-plugin/pull/47.diff","patch_url":"https://github.com/jenkinsci/maven-plugin/pull/47.patch","issue_url":"https://api.github.com/repos/jenkinsci/maven-plugin/issues/47","number":47,"state":"open","locked":false,"title":"JENKINS-23249 - implementation of POM_VERSION macro","user":{"login":"warden","id":521838,"avatar_url":"https://avatars3.githubusercontent.com/u/521838?v=4","gravatar_id":"","url":"https://api.github.com/users/warden","html_url":"https://github.com/warden","followers_url":"https://api.github.com/users/warden/followers","following_url":"https://api.github.com/users/warden/following{/other_user}","gists_url":"https://api.github.com/users/warden/gists{/gist_id}","starred_url":"https://api.github.com/users/warden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warden/subscriptions","organizations_url":"https://api.github.com/users/warden/orgs","repos_url":"https://api.github.com/users/warden/repos","events_url":"https://api.github.com/users/warden/events{/privacy}","received_events_url":"https://api.github.com/users/warden/received_events","type":"User","site_admin":false},"body":"<!-- Reviewable:start -->\n\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/jenkinsci/maven-plugin/47)\n\n<!-- Reviewable:end -->\n","created_at":"2015-06-19T05:21:41Z","updated_at":"2017-08-19T16:37:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b5b0bbfb7cef77d970e4301846a31e196d028cc","assignee":null,"assignees":[],"requested_reviewers":[{"login":"aheritier","id":174600,"avatar_url":"https://avatars0.githubusercontent.com/u/174600?v=4","gravatar_id":"","url":"https://api.github.com/users/aheritier","html_url":"https://github.com/aheritier","followers_url":"https://api.github.com/users/aheritier/followers","following_url":"https://api.github.com/users/aheritier/following{/other_user}","gists_url":"https://api.github.com/users/aheritier/gists{/gist_id}","starred_url":"https://api.github.com/users/aheritier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aheritier/subscriptions","organizations_url":"https://api.github.com/users/aheritier/orgs","repos_url":"https://api.github.com/users/aheritier/repos","events_url":"https://api.github.com/users/aheritier/events{/privacy}","received_events_url":"https://api.github.com/users/aheritier/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/maven-plugin/issues/47/comments","statuses_url":"https://api.github.com/repos/jenkinsci/maven-plugin/statuses/ebff715728e9f738804239cad9b4f1fb782a87c0","head":{"label":"QUIDDIA:master","ref":"master","sha":"ebff715728e9f738804239cad9b4f1fb782a87c0","user":{"login":"QUIDDIA","id":2108519,"avatar_url":"https://avatars2.githubusercontent.com/u/2108519?v=4","gravatar_id":"","url":"https://api.github.com/users/QUIDDIA","html_url":"https://github.com/QUIDDIA","followers_url":"https://api.github.com/users/QUIDDIA/followers","following_url":"https://api.github.com/users/QUIDDIA/following{/other_user}","gists_url":"https://api.github.com/users/QUIDDIA/gists{/gist_id}","starred_url":"https://api.github.com/users/QUIDDIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QUIDDIA/subscriptions","organizations_url":"https://api.github.com/users/QUIDDIA/orgs","repos_url":"https://api.github.com/users/QUIDDIA/repos","events_url":"https://api.github.com/users/QUIDDIA/events{/privacy}","received_events_url":"https://api.github.com/users/QUIDDIA/received_events","type":"Organization","site_admin":false},"repo":{"id":37702633,"name":"maven-plugin","full_name":"QUIDDIA/maven-plugin","owner":{"login":"QUIDDIA","id":2108519,"avatar_url":"https://avatars2.githubusercontent.com/u/2108519?v=4","gravatar_id":"","url":"https://api.github.com/users/QUIDDIA","html_url":"https://github.com/QUIDDIA","followers_url":"https://api.github.com/users/QUIDDIA/followers","following_url":"https://api.github.com/users/QUIDDIA/following{/other_user}","gists_url":"https://api.github.com/users/QUIDDIA/gists{/gist_id}","starred_url":"https://api.github.com/users/QUIDDIA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QUIDDIA/subscriptions","organizations_url":"https://api.github.com/users/QUIDDIA/orgs","repos_url":"https://api.github.com/users/QUIDDIA/repos","events_url":"https://api.github.com/users/QUIDDIA/events{/privacy}","received_events_url":"https://api.github.com/users/QUIDDIA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QUIDDIA/maven-plugin","description":null,"fork":true,"url":"https://api.github.com/repos/QUIDDIA/maven-plugin","forks_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/forks","keys_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/teams","hooks_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/hooks","issue_events_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/events","assignees_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/tags","blobs_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/languages","stargazers_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/stargazers","contributors_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/contributors","subscribers_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/subscribers","subscription_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/subscription","commits_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/merges","archive_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/downloads","issues_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/labels{/name}","releases_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/QUIDDIA/maven-plugin/deployments","created_at":"2015-06-19T05:05:05Z","updated_at":"2015-06-19T05:05:06Z","pushed_at":"2015-06-19T05:20:36Z","git_url":"git://github.com/QUIDDIA/maven-plugin.git","ssh_url":"git@github.com:QUIDDIA/maven-plugin.git","clone_url":"https://github.com/QUIDDIA/maven-plugin.git","svn_url":"https://github.com/QUIDDIA/maven-plugin","homepage":"","size":3575,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"1f1bacf5c2778cc8a2093b1749388281ad3fb97b","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":13022394,"name":"maven-plugin","full_name":"jenkinsci/maven-plugin","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/maven-plugin","description":null,"fork":false,"url":"https://api.github.com/repos/jenkinsci/maven-plugin","forks_url":"https://api.github.com/repos/jenkinsci/maven-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/maven-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/maven-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/maven-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/maven-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/maven-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/maven-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/maven-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/maven-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/maven-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/maven-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/maven-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/maven-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/maven-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/maven-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/maven-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/maven-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/maven-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/maven-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/maven-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/maven-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/maven-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/maven-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/maven-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/maven-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/maven-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/maven-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/maven-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/maven-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/maven-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/maven-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/maven-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/maven-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/maven-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/maven-plugin/deployments","created_at":"2013-09-22T22:52:27Z","updated_at":"2017-08-09T06:26:45Z","pushed_at":"2017-08-16T10:09:25Z","git_url":"git://github.com/jenkinsci/maven-plugin.git","ssh_url":"git@github.com:jenkinsci/maven-plugin.git","clone_url":"https://github.com/jenkinsci/maven-plugin.git","svn_url":"https://github.com/jenkinsci/maven-plugin","homepage":"","size":3611,"stargazers_count":28,"watchers_count":28,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":132,"mirror_url":null,"open_issues_count":10,"forks":132,"open_issues":10,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47"},"html":{"href":"https://github.com/jenkinsci/maven-plugin/pull/47"},"issue":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/issues/47"},"comments":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/maven-plugin/statuses/ebff715728e9f738804239cad9b4f1fb782a87c0"}}}}
{"actor":{"display_login":"warden"}}