{"action":"created","issue":{"url":"https://api.github.com/repos/johnrengelman/shadow/issues/341","repository_url":"https://api.github.com/repos/johnrengelman/shadow","labels_url":"https://api.github.com/repos/johnrengelman/shadow/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/johnrengelman/shadow/issues/341/comments","events_url":"https://api.github.com/repos/johnrengelman/shadow/issues/341/events","html_url":"https://github.com/johnrengelman/shadow/issues/341","id":273575759,"node_id":"MDU6SXNzdWUyNzM1NzU3NTk=","number":341,"title":"NoClassDefFoundError with Gradle 4.x","user":{"login":"reisub","id":992835,"node_id":"MDQ6VXNlcjk5MjgzNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/992835?v=4","gravatar_id":"","url":"https://api.github.com/users/reisub","html_url":"https://github.com/reisub","followers_url":"https://api.github.com/users/reisub/followers","following_url":"https://api.github.com/users/reisub/following{/other_user}","gists_url":"https://api.github.com/users/reisub/gists{/gist_id}","starred_url":"https://api.github.com/users/reisub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisub/subscriptions","organizations_url":"https://api.github.com/users/reisub/orgs","repos_url":"https://api.github.com/users/reisub/repos","events_url":"https://api.github.com/users/reisub/events{/privacy}","received_events_url":"https://api.github.com/users/reisub/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-13T20:59:38Z","updated_at":"2018-12-09T17:42:16Z","closed_at":"2018-12-09T17:42:16Z","author_association":"NONE","body":"@johnrengelman first let me just say - thanks for the really great project, it helps a lot and I use it for lots of different projects. You've done a great job!\r\n\r\nWhile I realize the README states compatibility with Gradle 3.x and 4.0 nightlies, I want to add this issue for anyone out there who runs into the same issue while routinely bumping gradle versions or not reading the README carefully enough :)\r\n\r\nAnd maybe someone decides to help out and fix this issue.\r\n\r\nThis is the exception I get:\r\n\r\n```\r\njava.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jetty.server.HttpConnection\r\n    at org.eclipse.jetty.server.HttpConnectionFactory.newConnection(HttpConnectionFactory.java:85)\r\n    at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:482)\r\n    at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:424)\r\n    at org.eclipse.jetty.io.ManagedSelector.access$1600(ManagedSelector.java:61)\r\n    at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:603)\r\n    at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)\r\n    at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)\r\n    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)\r\n    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)\r\n    at java.lang.Thread.run(Thread.java:745)\r\n```\r\n\r\nPlease check the (User Guide)[http://imperceptiblethoughts.com/shadow] before submitting \"how do I do 'x'?\" questions!\r\n\r\n### Shadow Version\r\n\r\n2.0.1\r\n\r\n### Gradle Version\r\n\r\n4.x\r\n\r\n### Expected Behavior\r\n\r\nBuilt shadow jar works like on earlier Gradle versions since it builds without error.\r\n\r\n### Actual Behavior\r\n\r\n`NoClassDefFoundError` is thrown at runtime, although the referenced class is contained within the shadow jar.\r\n\r\n### Gradle Build Script(s)\r\n\r\nhttps://gist.github.com/reisub/c7b1570f10a60b33312d7d22c7f447d4\r\n\r\n### Content of Shadow JAR (`jar tf <jar file>` - post link to GIST if too long)\r\n\r\nhttps://gist.github.com/reisub/97684e38b69113d9bce7f31f90c802bc"},"comment":{"url":"https://api.github.com/repos/johnrengelman/shadow/issues/comments/445556737","html_url":"https://github.com/johnrengelman/shadow/issues/341#issuecomment-445556737","issue_url":"https://api.github.com/repos/johnrengelman/shadow/issues/341","id":445556737,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTU1NjczNw==","user":{"login":"reisub","id":992835,"node_id":"MDQ6VXNlcjk5MjgzNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/992835?v=4","gravatar_id":"","url":"https://api.github.com/users/reisub","html_url":"https://github.com/reisub","followers_url":"https://api.github.com/users/reisub/followers","following_url":"https://api.github.com/users/reisub/following{/other_user}","gists_url":"https://api.github.com/users/reisub/gists{/gist_id}","starred_url":"https://api.github.com/users/reisub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisub/subscriptions","organizations_url":"https://api.github.com/users/reisub/orgs","repos_url":"https://api.github.com/users/reisub/repos","events_url":"https://api.github.com/users/reisub/events{/privacy}","received_events_url":"https://api.github.com/users/reisub/received_events","type":"User","site_admin":false},"created_at":"2018-12-09T17:42:16Z","updated_at":"2018-12-09T17:42:16Z","author_association":"NONE","body":"I found the solution here:\r\nhttps://stackoverflow.com/a/48698984/2643666\r\n\r\nTL;DR adding this into my `build.gradle` fixed the problem:\r\n\r\n```\r\nshadowJar {\r\n    transform(ServiceFileTransformer) {\r\n        path = 'META-INF/services'\r\n        include 'org.eclipse.jetty.http.HttpFieldPreEncoder'\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"reisub"}}