{"action":"created","comment":{"url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/comments/91836516","pull_request_review_id":12349233,"id":91836516,"diff_hunk":"@@ -0,0 +1,111 @@\n+package io.fabric8.vertx.maven.plugin.it.invoker;\n+\n+\n+import org.apache.maven.it.VerificationException;\n+import org.apache.maven.it.Verifier;\n+import org.apache.maven.shared.invoker.DefaultInvocationRequest;\n+import org.apache.maven.shared.invoker.InvokerLogger;\n+import org.apache.maven.shared.invoker.PrintStreamHandler;\n+import org.apache.maven.shared.invoker.PrintStreamLogger;\n+import org.apache.maven.shared.utils.cli.CommandLineUtils;\n+\n+import java.io.File;\n+import java.io.PrintStream;\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Properties;\n+\n+/**\n+ * Created by clement on 09/12/16.\n+ */\n+public class ControlledVerifier extends Verifier {\n+\n+    private String defaultMavenHome;\n+\n+    private ControlledInvocationResult result;\n+\n+    public ControlledVerifier(String basedir) throws VerificationException {\n+        super(basedir, true);\n+    }\n+\n+    public void stop() {\n+        if (result == null) {\n+            return;\n+        }\n+        result.destroy();\n+    }\n+\n+    @Override\n+    public void executeGoals(List<String> goals, Map<String, String> envVars) throws VerificationException {\n+        DefaultInvocationRequest request = new DefaultInvocationRequest();\n+        ControlledInvoker invoker = new ControlledInvoker();\n+\n+        List<String> allGoals = new ArrayList<>();\n+\n+        if (isAutoclean()) {\n+            allGoals.add(\"org.apache.maven.plugins:maven-clean-plugin:clean\");\n+        }\n+\n+        allGoals.addAll(goals);\n+\n+        request.setGoals(allGoals);\n+\n+        File logFile = new File(getBasedir(), getLogFileName());\n+\n+\n+        request.setDebug(isMavenDebug());\n+\n+        /*\n+         * NOTE: Unless explicitly requested by the caller, the forked builds should use the current local\n+         * repository. Otherwise, the forked builds would in principle leave the sandbox environment which has been\n+         * setup for the current build. In particular, using \"maven.repo.local\" will make sure the forked builds use\n+         * the same local repo as the parent build even if a custom user settings is provided.\n+         */\n+        boolean useMavenRepoLocal = Boolean.valueOf(getVerifierProperties().getProperty(\"use.mavenRepoLocal\", \"true\"));\n+\n+        if (useMavenRepoLocal) {\n+            request.setLocalRepositoryDirectory(new File(getLocalRepository()));\n+            invoker.setLocalRepositoryDirectory(new File(getLocalRepository()));\n+        }\n+\n+        try {\n+//            MavenProcessLauncher launcher =\n+//                new MavenProcessLauncher( defaultMavenHome, envVars, isDebugJvm() );\n+\n+            request.setBaseDirectory(new File(getBasedir()));\n+            request.setPomFile(new File(getBasedir(), \"pom.xml\"));\n+\n+\n+            PrintStream log = new PrintStream(logFile);\n+            invoker.setErrorHandler(new PrintStreamHandler(log, true));\n+            invoker.setOutputHandler(new PrintStreamHandler(log, true));\n+            invoker.setLogger(new PrintStreamLogger(log, InvokerLogger.INFO));\n+            findDefaultMavenHome();\n+            invoker.setMavenHome(new File(defaultMavenHome));\n+            invoker.setWorkingDirectory(new File(getBasedir()));\n+            request.setOutputHandler(new PrintStreamHandler(log, true));\n+\n+            result = (ControlledInvocationResult) invoker.execute(request);\n+        } catch (Exception e) {\n+            throw new VerificationException(e);\n+        }\n+    }\n+\n+    private void findDefaultMavenHome()\n+        throws VerificationException {\n+        defaultMavenHome = System.getProperty(\"maven.home\");\n+\n+        if (defaultMavenHome == null) {\n+            Properties envVars = CommandLineUtils.getSystemEnvVars();\n+            defaultMavenHome = envVars.getProperty(\"M2_HOME\");\n+        }\n+\n+        if (defaultMavenHome == null) {\n+            File f = new File(System.getProperty(\"user.home\"), \"m2\");\n+            if (new File(f, \"bin/mvn\").isFile()) {\n+                defaultMavenHome = f.getAbsolutePath();\n+            }\n+        }\n+    }\n+}","path":"src/test/java/io/fabric8/vertx/maven/plugin/it/invoker/ControlledVerifier.java","position":null,"original_position":111,"commit_id":"3cfe768dcbd320ee5f7a66eb5162eceaa31e2cfb","original_commit_id":"b24179ae97d2bdcc7e6e505c13d3b404f169155a","user":{"login":"kameshsampath","id":947745,"avatar_url":"https://avatars.githubusercontent.com/u/947745?v=3","gravatar_id":"","url":"https://api.github.com/users/kameshsampath","html_url":"https://github.com/kameshsampath","followers_url":"https://api.github.com/users/kameshsampath/followers","following_url":"https://api.github.com/users/kameshsampath/following{/other_user}","gists_url":"https://api.github.com/users/kameshsampath/gists{/gist_id}","starred_url":"https://api.github.com/users/kameshsampath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kameshsampath/subscriptions","organizations_url":"https://api.github.com/users/kameshsampath/orgs","repos_url":"https://api.github.com/users/kameshsampath/repos","events_url":"https://api.github.com/users/kameshsampath/events{/privacy}","received_events_url":"https://api.github.com/users/kameshsampath/received_events","type":"User","site_admin":false},"body":"just a thought if we can use mvnWrapper if we dont find maven anywhere ? why cant we base all our tests to use mvnWrapper - so that we can stay close to the version are targetting and add the same via maven enforcer plugin?","created_at":"2016-12-10T15:03:19Z","updated_at":"2016-12-10T15:03:19Z","html_url":"https://github.com/fabric8io/vertx-maven-plugin/pull/49#discussion_r91836516","pull_request_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/comments/91836516"},"html":{"href":"https://github.com/fabric8io/vertx-maven-plugin/pull/49#discussion_r91836516"},"pull_request":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49","id":97425108,"html_url":"https://github.com/fabric8io/vertx-maven-plugin/pull/49","diff_url":"https://github.com/fabric8io/vertx-maven-plugin/pull/49.diff","patch_url":"https://github.com/fabric8io/vertx-maven-plugin/pull/49.patch","issue_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/49","number":49,"state":"open","locked":false,"title":"Improve redeploy integration tests","user":{"login":"cescoffier","id":402301,"avatar_url":"https://avatars.githubusercontent.com/u/402301?v=3","gravatar_id":"","url":"https://api.github.com/users/cescoffier","html_url":"https://github.com/cescoffier","followers_url":"https://api.github.com/users/cescoffier/followers","following_url":"https://api.github.com/users/cescoffier/following{/other_user}","gists_url":"https://api.github.com/users/cescoffier/gists{/gist_id}","starred_url":"https://api.github.com/users/cescoffier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cescoffier/subscriptions","organizations_url":"https://api.github.com/users/cescoffier/orgs","repos_url":"https://api.github.com/users/cescoffier/repos","events_url":"https://api.github.com/users/cescoffier/events{/privacy}","received_events_url":"https://api.github.com/users/cescoffier/received_events","type":"User","site_admin":false},"body":"Use a new approach for checking the behavior of the redeployment:\r\n\r\n 1. happens\r\n2. has the desired effect on both Maven and the Vert.x application\r\n\r\nAs the Maven process is kept alive the traditional verifier approach (as mention in #47) cannot be used and so a specific invoker and verifier have been implemented to better control the Maven process (and kill it ;-))","created_at":"2016-12-10T13:41:46Z","updated_at":"2016-12-10T15:03:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e2296449394db599524941391b094b9491bc18d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49/commits","review_comments_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49/comments","review_comment_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/49/comments","statuses_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/statuses/3cfe768dcbd320ee5f7a66eb5162eceaa31e2cfb","head":{"label":"fabric8io:issues/#47","ref":"issues/#47","sha":"3cfe768dcbd320ee5f7a66eb5162eceaa31e2cfb","user":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"repo":{"id":74113324,"name":"vertx-maven-plugin","full_name":"fabric8io/vertx-maven-plugin","owner":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8io/vertx-maven-plugin","description":"Vert.x Maven Plugin - https://vmp.fabric8.io","fork":false,"url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin","forks_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/forks","keys_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/teams","hooks_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/hooks","issue_events_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/events","assignees_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/tags","blobs_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/languages","stargazers_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/stargazers","contributors_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/contributors","subscribers_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/subscribers","subscription_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/subscription","commits_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/merges","archive_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/downloads","issues_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/labels{/name}","releases_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/deployments","created_at":"2016-11-18T09:07:37Z","updated_at":"2016-12-08T16:15:16Z","pushed_at":"2016-12-10T14:56:02Z","git_url":"git://github.com/fabric8io/vertx-maven-plugin.git","ssh_url":"git@github.com:fabric8io/vertx-maven-plugin.git","clone_url":"https://github.com/fabric8io/vertx-maven-plugin.git","svn_url":"https://github.com/fabric8io/vertx-maven-plugin","homepage":"","size":519,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"fabric8io:master","ref":"master","sha":"bd07792880d7780658336a767aba256c416cc24d","user":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"repo":{"id":74113324,"name":"vertx-maven-plugin","full_name":"fabric8io/vertx-maven-plugin","owner":{"login":"fabric8io","id":6074349,"avatar_url":"https://avatars.githubusercontent.com/u/6074349?v=3","gravatar_id":"","url":"https://api.github.com/users/fabric8io","html_url":"https://github.com/fabric8io","followers_url":"https://api.github.com/users/fabric8io/followers","following_url":"https://api.github.com/users/fabric8io/following{/other_user}","gists_url":"https://api.github.com/users/fabric8io/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8io/subscriptions","organizations_url":"https://api.github.com/users/fabric8io/orgs","repos_url":"https://api.github.com/users/fabric8io/repos","events_url":"https://api.github.com/users/fabric8io/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8io/vertx-maven-plugin","description":"Vert.x Maven Plugin - https://vmp.fabric8.io","fork":false,"url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin","forks_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/forks","keys_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/teams","hooks_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/hooks","issue_events_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/events","assignees_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/tags","blobs_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/languages","stargazers_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/stargazers","contributors_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/contributors","subscribers_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/subscribers","subscription_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/subscription","commits_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/merges","archive_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/downloads","issues_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/labels{/name}","releases_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/deployments","created_at":"2016-11-18T09:07:37Z","updated_at":"2016-12-08T16:15:16Z","pushed_at":"2016-12-10T14:56:02Z","git_url":"git://github.com/fabric8io/vertx-maven-plugin.git","ssh_url":"git@github.com:fabric8io/vertx-maven-plugin.git","clone_url":"https://github.com/fabric8io/vertx-maven-plugin.git","svn_url":"https://github.com/fabric8io/vertx-maven-plugin","homepage":"","size":519,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49"},"html":{"href":"https://github.com/fabric8io/vertx-maven-plugin/pull/49"},"issue":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/49"},"comments":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/fabric8io/vertx-maven-plugin/statuses/3cfe768dcbd320ee5f7a66eb5162eceaa31e2cfb"}}}}
{"actor":{"display_login":"kameshsampath"}}