{"action":"closed","issue":{"url":"https://api.github.com/repos/scalameter/scalameter/issues/182","repository_url":"https://api.github.com/repos/scalameter/scalameter","labels_url":"https://api.github.com/repos/scalameter/scalameter/issues/182/labels{/name}","comments_url":"https://api.github.com/repos/scalameter/scalameter/issues/182/comments","events_url":"https://api.github.com/repos/scalameter/scalameter/issues/182/events","html_url":"https://github.com/scalameter/scalameter/issues/182","id":229641725,"number":182,"title":"`HtmlReporter` copies first `index.html` found on classpath instead of correct one","user":{"login":"zegerhoogeboom","id":5371096,"avatar_url":"https://avatars2.githubusercontent.com/u/5371096?v=3","gravatar_id":"","url":"https://api.github.com/users/zegerhoogeboom","html_url":"https://github.com/zegerhoogeboom","followers_url":"https://api.github.com/users/zegerhoogeboom/followers","following_url":"https://api.github.com/users/zegerhoogeboom/following{/other_user}","gists_url":"https://api.github.com/users/zegerhoogeboom/gists{/gist_id}","starred_url":"https://api.github.com/users/zegerhoogeboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zegerhoogeboom/subscriptions","organizations_url":"https://api.github.com/users/zegerhoogeboom/orgs","repos_url":"https://api.github.com/users/zegerhoogeboom/repos","events_url":"https://api.github.com/users/zegerhoogeboom/events{/privacy}","received_events_url":"https://api.github.com/users/zegerhoogeboom/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-18T11:44:12Z","updated_at":"2017-05-23T19:44:14Z","closed_at":"2017-05-23T19:44:14Z","body":"The `HtmlReporter` currently copies the first `index.html` found on the classpath. This is done on line 151: `val res = getClass.getClassLoader.getResourceAsStream(from)`. This means that when there are multiple `index.html` files on the classpath, which is mainly caused by loading multiple JAR's which _also_ contain an `index.html` file. I guess the same goes for the other static files in `css/*` etc. In my case this cause another `index.html` to be loaded and thus I could not view the results. \r\n\r\nI did a very dirty quick fix by just copying the `HtmlReporter` in a class of my own and updating the loading to \r\n```\r\n    val resources = getClass.getClassLoader.getResources(from)\r\n    var res: InputStream = null\r\n    var done = false\r\n    while (resources.hasMoreElements && !done) {\r\n      val next = resources.nextElement()\r\n      if (next.getPath.contains(\"scalameter\")) {\r\n        res = next.openStream()\r\n        done = true\r\n      }\r\n    }\r\n```\r\n\r\nI guess there would be a more elegant way of doing this, although it works. If you would like to make a PR with this, let me know."}}
{"actor":{"display_login":"storm-enroute-bot"}}