{"action":"created","comment":{"url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/comments/40599804","id":40599804,"diff_hunk":"@@ -85,57 +85,23 @@ class JRubyPlugin implements Plugin<Project> {\n         }\n     }\n \n-    // can not cast same object from different classloaders\n-    private Object server;\n-    private Object embeddedServer(Project project) {\n-        if (server == null) {\n-            // TODO maybe things will work now without cloning\n-            // clone the current classloader without its parent\n-            \n-            // assume we run inside an URLClassLoader which might\n-            // not always be the case (OSGi, J2EE, etc)\n-            List<URL> urls = new LinkedList<URL>()\n-            URL warFileURL\n-            RubygemsServlet.class.getClassLoader().getURLs().each {\n-                if (it.file.endsWith(\".war\") ) {\n-                    warFileURL = it\n-                }\n-                // for integTest we need to filter some jars here\n-                else if (!it.file.contains('bcprov-jdk15')) {\n-                    urls.add(it)\n-                }\n-            }\n-            ClassLoader extClassLoader = getClass().getClassLoader().getSystemClassLoader().parent\n-            ClassLoader cl = new URLClassLoader(urls.toArray(new URL[urls.size()]), extClassLoader)\n-            // can not cast\n-            Object servlet = cl.loadClass(RubygemsServlet.class.getName())\n-            server = servlet.create(warFileURL)\n-        }\n-        server\n-    }\n-\n-    private boolean serverStarted = false\n-    private void startEmbeddedServer(Project project) {\n-        if (server != null && !serverStarted) {\n-            // we need to set the current thread context class loader\n-            // for starting up the webapps\n-            ClassLoader current = Thread.currentThread().contextClassLoader\n-            try {\n-                Thread.currentThread().setContextClassLoader(server.class.classLoader)\n-                if (project.logger.isDebugEnabled()) {\n-                    server.enableLogging()\n-                }\n-                server.start()\n-                serverStarted = true\n-                project.gradle.buildFinished {\n-                    server.stop()\n-                    server.class.classLoader.close()\n-                    server = null\n-                }\n-            }\n-            finally {\n-                Thread.currentThread().setContextClassLoader(current)\n-            }\n+    private void setupMavenGemProtocol(Project project) {\n+        project.repositories {\n+            jcenter()\n         }\n+        //if (! Handler.isMavenGemProtocolRegistered()) {\n+            Dependency dep = project.dependencies.create(\"org.sonatype.nexus.plugins:nexus-ruby-tools:2.11.4-01\")\n+            Configuration config = project.configurations.detachedConfiguration(dep)","path":"jruby-gradle-base-plugin/src/main/groovy/com/github/jrubygradle/JRubyPlugin.groovy","position":92,"original_position":92,"commit_id":"dc8fdda44416ea9847eceee16665116ce948f536","original_commit_id":"dc8fdda44416ea9847eceee16665116ce948f536","user":{"login":"rtyler","id":26594,"avatar_url":"https://avatars.githubusercontent.com/u/26594?v=3","gravatar_id":"","url":"https://api.github.com/users/rtyler","html_url":"https://github.com/rtyler","followers_url":"https://api.github.com/users/rtyler/followers","following_url":"https://api.github.com/users/rtyler/following{/other_user}","gists_url":"https://api.github.com/users/rtyler/gists{/gist_id}","starred_url":"https://api.github.com/users/rtyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtyler/subscriptions","organizations_url":"https://api.github.com/users/rtyler/orgs","repos_url":"https://api.github.com/users/rtyler/repos","events_url":"https://api.github.com/users/rtyler/events{/privacy}","received_events_url":"https://api.github.com/users/rtyler/received_events","type":"User","site_admin":false},"body":"Will you add some more comments to this function, so I can understand what wizardry is happening here too :)","created_at":"2015-09-28T20:17:06Z","updated_at":"2015-09-28T20:17:06Z","html_url":"https://github.com/jruby-gradle/jruby-gradle-plugin/pull/241#discussion_r40599804","pull_request_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241","_links":{"self":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/comments/40599804"},"html":{"href":"https://github.com/jruby-gradle/jruby-gradle-plugin/pull/241#discussion_r40599804"},"pull_request":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241"}}},"pull_request":{"url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241","id":46192013,"html_url":"https://github.com/jruby-gradle/jruby-gradle-plugin/pull/241","diff_url":"https://github.com/jruby-gradle/jruby-gradle-plugin/pull/241.diff","patch_url":"https://github.com/jruby-gradle/jruby-gradle-plugin/pull/241.patch","issue_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues/241","number":241,"state":"open","locked":false,"title":"trial to add direct rubygems repo support via custom url protocol","user":{"login":"mkristian","id":35058,"avatar_url":"https://avatars.githubusercontent.com/u/35058?v=3","gravatar_id":"","url":"https://api.github.com/users/mkristian","html_url":"https://github.com/mkristian","followers_url":"https://api.github.com/users/mkristian/followers","following_url":"https://api.github.com/users/mkristian/following{/other_user}","gists_url":"https://api.github.com/users/mkristian/gists{/gist_id}","starred_url":"https://api.github.com/users/mkristian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkristian/subscriptions","organizations_url":"https://api.github.com/users/mkristian/orgs","repos_url":"https://api.github.com/users/mkristian/repos","events_url":"https://api.github.com/users/mkristian/events{/privacy}","received_events_url":"https://api.github.com/users/mkristian/received_events","type":"User","site_admin":false},"body":"probably there is no way around this error\r\n```\r\n* What went wrong:\r\nExecution failed for task ':dependencies'.\r\n> Could not resolve all dependencies for configuration ':gems'.\r\n   > You may only specify 'file', 'http', 'https' and 'sftp' URLs for a repository.\r\n```\r\n\r\neven if the ```mavengem:``` protocol should/could be treated as the file protocol.","created_at":"2015-09-28T18:39:42Z","updated_at":"2015-09-28T20:17:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a60cb6d99f4bd1528d0e71028975aaf07d1c6c14","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241/commits","review_comments_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241/comments","review_comment_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues/241/comments","statuses_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/statuses/dc8fdda44416ea9847eceee16665116ce948f536","head":{"label":"mkristian:mavengem","ref":"mavengem","sha":"dc8fdda44416ea9847eceee16665116ce948f536","user":{"login":"mkristian","id":35058,"avatar_url":"https://avatars.githubusercontent.com/u/35058?v=3","gravatar_id":"","url":"https://api.github.com/users/mkristian","html_url":"https://github.com/mkristian","followers_url":"https://api.github.com/users/mkristian/followers","following_url":"https://api.github.com/users/mkristian/following{/other_user}","gists_url":"https://api.github.com/users/mkristian/gists{/gist_id}","starred_url":"https://api.github.com/users/mkristian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkristian/subscriptions","organizations_url":"https://api.github.com/users/mkristian/orgs","repos_url":"https://api.github.com/users/mkristian/repos","events_url":"https://api.github.com/users/mkristian/events{/privacy}","received_events_url":"https://api.github.com/users/mkristian/received_events","type":"User","site_admin":false},"repo":{"id":34002766,"name":"jruby-gradle-plugin","full_name":"mkristian/jruby-gradle-plugin","owner":{"login":"mkristian","id":35058,"avatar_url":"https://avatars.githubusercontent.com/u/35058?v=3","gravatar_id":"","url":"https://api.github.com/users/mkristian","html_url":"https://github.com/mkristian","followers_url":"https://api.github.com/users/mkristian/followers","following_url":"https://api.github.com/users/mkristian/following{/other_user}","gists_url":"https://api.github.com/users/mkristian/gists{/gist_id}","starred_url":"https://api.github.com/users/mkristian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkristian/subscriptions","organizations_url":"https://api.github.com/users/mkristian/orgs","repos_url":"https://api.github.com/users/mkristian/repos","events_url":"https://api.github.com/users/mkristian/events{/privacy}","received_events_url":"https://api.github.com/users/mkristian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mkristian/jruby-gradle-plugin","description":"A Gradle plugin for working with JRuby projects for fun and profit. Mostly profit.","fork":true,"url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin","forks_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/forks","keys_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/teams","hooks_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/hooks","issue_events_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/events","assignees_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/tags","blobs_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/languages","stargazers_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/stargazers","contributors_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/contributors","subscribers_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/subscribers","subscription_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/subscription","commits_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/merges","archive_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/downloads","issues_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/labels{/name}","releases_url":"https://api.github.com/repos/mkristian/jruby-gradle-plugin/releases{/id}","created_at":"2015-04-15T15:36:46Z","updated_at":"2015-04-15T15:36:47Z","pushed_at":"2015-09-28T20:15:07Z","git_url":"git://github.com/mkristian/jruby-gradle-plugin.git","ssh_url":"git@github.com:mkristian/jruby-gradle-plugin.git","clone_url":"https://github.com/mkristian/jruby-gradle-plugin.git","svn_url":"https://github.com/mkristian/jruby-gradle-plugin","homepage":null,"size":978,"stargazers_count":0,"watchers_count":0,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"jruby-gradle:master","ref":"master","sha":"601f462742b7f82071cd8f3564bd6de57df39cae","user":{"login":"jruby-gradle","id":8550762,"avatar_url":"https://avatars.githubusercontent.com/u/8550762?v=3","gravatar_id":"","url":"https://api.github.com/users/jruby-gradle","html_url":"https://github.com/jruby-gradle","followers_url":"https://api.github.com/users/jruby-gradle/followers","following_url":"https://api.github.com/users/jruby-gradle/following{/other_user}","gists_url":"https://api.github.com/users/jruby-gradle/gists{/gist_id}","starred_url":"https://api.github.com/users/jruby-gradle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jruby-gradle/subscriptions","organizations_url":"https://api.github.com/users/jruby-gradle/orgs","repos_url":"https://api.github.com/users/jruby-gradle/repos","events_url":"https://api.github.com/users/jruby-gradle/events{/privacy}","received_events_url":"https://api.github.com/users/jruby-gradle/received_events","type":"Organization","site_admin":false},"repo":{"id":22769318,"name":"jruby-gradle-plugin","full_name":"jruby-gradle/jruby-gradle-plugin","owner":{"login":"jruby-gradle","id":8550762,"avatar_url":"https://avatars.githubusercontent.com/u/8550762?v=3","gravatar_id":"","url":"https://api.github.com/users/jruby-gradle","html_url":"https://github.com/jruby-gradle","followers_url":"https://api.github.com/users/jruby-gradle/followers","following_url":"https://api.github.com/users/jruby-gradle/following{/other_user}","gists_url":"https://api.github.com/users/jruby-gradle/gists{/gist_id}","starred_url":"https://api.github.com/users/jruby-gradle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jruby-gradle/subscriptions","organizations_url":"https://api.github.com/users/jruby-gradle/orgs","repos_url":"https://api.github.com/users/jruby-gradle/repos","events_url":"https://api.github.com/users/jruby-gradle/events{/privacy}","received_events_url":"https://api.github.com/users/jruby-gradle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jruby-gradle/jruby-gradle-plugin","description":"A Gradle plugin for working with JRuby projects for fun and profit. Mostly profit.","fork":false,"url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin","forks_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/forks","keys_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/teams","hooks_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/hooks","issue_events_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/events","assignees_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/tags","blobs_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/languages","stargazers_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/stargazers","contributors_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/contributors","subscribers_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/subscribers","subscription_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/subscription","commits_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/merges","archive_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/downloads","issues_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/releases{/id}","created_at":"2014-08-08T19:35:28Z","updated_at":"2015-09-24T18:50:17Z","pushed_at":"2015-09-28T20:15:07Z","git_url":"git://github.com/jruby-gradle/jruby-gradle-plugin.git","ssh_url":"git@github.com:jruby-gradle/jruby-gradle-plugin.git","clone_url":"https://github.com/jruby-gradle/jruby-gradle-plugin.git","svn_url":"https://github.com/jruby-gradle/jruby-gradle-plugin","homepage":"http://jruby-gradle.org","size":1798,"stargazers_count":48,"watchers_count":48,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":38,"forks":11,"open_issues":38,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241"},"html":{"href":"https://github.com/jruby-gradle/jruby-gradle-plugin/pull/241"},"issue":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues/241"},"comments":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/issues/241/comments"},"review_comments":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241/comments"},"review_comment":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/pulls/241/commits"},"statuses":{"href":"https://api.github.com/repos/jruby-gradle/jruby-gradle-plugin/statuses/dc8fdda44416ea9847eceee16665116ce948f536"}}}}