{"action":"created","comment":{"url":"https://api.github.com/repos/lagom/lagom/pulls/comments/73465939","id":73465939,"diff_hunk":"@@ -159,26 +160,46 @@ class Reloader(\n   // Whether any source files have changed since the last request.\n   @volatile private var changed = false\n   // The last successful compile results. Used for rendering nice errors.\n-  @volatile private var currentSourceMap = Option.empty[SourceMap]\n+  @volatile private var currentSourceMap = Option.empty[Map[String, Source]]\n   // A watch state for the classpath. Used to determine whether anything on the classpath has changed as a result\n   // of compilation, and therefore a new classloader is needed and the app needs to be reloaded.\n   @volatile private var watchState: WatchState = WatchState.empty\n \n+  // Stores the most recent time that a file was changed\n+  private val fileLastChanged = new AtomicReference[Instant]()\n+\n   // Create the watcher, updates the changed boolean when a file has changed.\n   private val watcher = fileWatchService.watch(monitoredFiles, () => {\n+\n     changed = true\n     onChange()\n   })\n   private val classLoaderVersion = new java.util.concurrent.atomic.AtomicInteger(0)\n \n-  private val listeners = new java.util.concurrent.CopyOnWriteArrayList[Unit => Unit]()\n+  private val quietTimeTimer = new Timer(\"reloader-timer\", true)\n+\n+  private val listeners = new java.util.concurrent.CopyOnWriteArrayList[() => Unit]()\n \n+  private val quietPeriodMs = 200l\n   private def onChange(): Unit = {\n-    import scala.collection.JavaConverters._\n-    listeners.iterator().asScala.foreach(listener => listener())\n+    val now = Instant.now()\n+    fileLastChanged.set(now)","path":"dev/build-tool-support/src/main/scala/com/lightbend/lagom/dev/Reloader.scala","position":152,"original_position":152,"commit_id":"1a35a8ce014552c9be9e361b31c273152a92298c","original_commit_id":"3253ddad24c4aa5f2f9b6a4f25231d88e226b7c9","user":{"login":"dotta","id":703748,"avatar_url":"https://avatars.githubusercontent.com/u/703748?v=3","gravatar_id":"","url":"https://api.github.com/users/dotta","html_url":"https://github.com/dotta","followers_url":"https://api.github.com/users/dotta/followers","following_url":"https://api.github.com/users/dotta/following{/other_user}","gists_url":"https://api.github.com/users/dotta/gists{/gist_id}","starred_url":"https://api.github.com/users/dotta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotta/subscriptions","organizations_url":"https://api.github.com/users/dotta/orgs","repos_url":"https://api.github.com/users/dotta/repos","events_url":"https://api.github.com/users/dotta/events{/privacy}","received_events_url":"https://api.github.com/users/dotta/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2016-08-04T05:59:51Z","updated_at":"2016-08-04T05:59:51Z","html_url":"https://github.com/lagom/lagom/pull/137#discussion_r73465939","pull_request_url":"https://api.github.com/repos/lagom/lagom/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/lagom/lagom/pulls/comments/73465939"},"html":{"href":"https://github.com/lagom/lagom/pull/137#discussion_r73465939"},"pull_request":{"href":"https://api.github.com/repos/lagom/lagom/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/lagom/lagom/pulls/137","id":79523504,"html_url":"https://github.com/lagom/lagom/pull/137","diff_url":"https://github.com/lagom/lagom/pull/137.diff","patch_url":"https://github.com/lagom/lagom/pull/137.patch","issue_url":"https://api.github.com/repos/lagom/lagom/issues/137","number":137,"state":"open","locked":false,"title":"Initial maven support","user":{"login":"jroper","id":105833,"avatar_url":"https://avatars.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},"body":"This is initial support for maven. The main thing here is that the Lagom development environment is working. Cassandra gets started, the service locator gets started, every project gets started and configured correctly with dev mode dependencies injected, and hot reloads work.\n\nI've tested this with the helloworld Lagom seed project, which I've converted to use maven here:\n\nhttps://github.com/jroper/lagom-helloworld-maven\n\nThe general approach to implementation has been:\n\n* Extract and abstract common utilities into lagom-build-tool-support\n* Create lagom-maven-plugin\n* I've manually created the maven META-INF/maven/plugin.xml file, when using maven to develop a maven plugin, this file is usually generated from annotations. I investigated whether it was feasible to reuse the maven generation tool, the amount of code in the ant plugin to bootstrap maven itself in order to run this plugin doesn't make it look like it's worth it.\n* Most of the interactions with maven happen in the MavenFacade class, this includes executing lifecycle phases such as compile, and resolving dependencies.\n* I've generally stuck to using quite low level maven APIs, for example, it's really trivial to execute a lifecycle phase on a particular project and all its upstream dependencies if using the maven execution API, however using this means each time its run, pom files have to be reparsed, dependencies reresolved, each time you run it, which is slow. So instead, to run a compile for example, I get all the projects I need to run it on, then look up all the tasks that make up the compile lifecycle, then run each one of them.\n\nThere's a lot left to do, here's an incomplete list:\n\n* Create some sort of test environment for testing the maven plugin, and write tests.\n* Source map and compile error handling (not sure if possible).\n* Emebbeded Play project support (needed for chirper).\n* External project support.\n* Configurable dev settings.\n* Documentation.\n* Generate the parts of plugin.xml that are dependent on the build/version etc.\n* Create maven archetypes for helloworld and chirper.","created_at":"2016-08-01T07:17:29Z","updated_at":"2016-08-04T05:59:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"617d32be0d763381d8000a0a10cc7a0e2b086647","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lagom/lagom/pulls/137/commits","review_comments_url":"https://api.github.com/repos/lagom/lagom/pulls/137/comments","review_comment_url":"https://api.github.com/repos/lagom/lagom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lagom/lagom/issues/137/comments","statuses_url":"https://api.github.com/repos/lagom/lagom/statuses/1a35a8ce014552c9be9e361b31c273152a92298c","head":{"label":"jroper:maven","ref":"maven","sha":"1a35a8ce014552c9be9e361b31c273152a92298c","user":{"login":"jroper","id":105833,"avatar_url":"https://avatars.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},"repo":{"id":53542964,"name":"lagom","full_name":"jroper/lagom","owner":{"login":"jroper","id":105833,"avatar_url":"https://avatars.githubusercontent.com/u/105833?v=3","gravatar_id":"","url":"https://api.github.com/users/jroper","html_url":"https://github.com/jroper","followers_url":"https://api.github.com/users/jroper/followers","following_url":"https://api.github.com/users/jroper/following{/other_user}","gists_url":"https://api.github.com/users/jroper/gists{/gist_id}","starred_url":"https://api.github.com/users/jroper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jroper/subscriptions","organizations_url":"https://api.github.com/users/jroper/orgs","repos_url":"https://api.github.com/users/jroper/repos","events_url":"https://api.github.com/users/jroper/events{/privacy}","received_events_url":"https://api.github.com/users/jroper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jroper/lagom","description":"Reactive Microservices for the JVM","fork":true,"url":"https://api.github.com/repos/jroper/lagom","forks_url":"https://api.github.com/repos/jroper/lagom/forks","keys_url":"https://api.github.com/repos/jroper/lagom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jroper/lagom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jroper/lagom/teams","hooks_url":"https://api.github.com/repos/jroper/lagom/hooks","issue_events_url":"https://api.github.com/repos/jroper/lagom/issues/events{/number}","events_url":"https://api.github.com/repos/jroper/lagom/events","assignees_url":"https://api.github.com/repos/jroper/lagom/assignees{/user}","branches_url":"https://api.github.com/repos/jroper/lagom/branches{/branch}","tags_url":"https://api.github.com/repos/jroper/lagom/tags","blobs_url":"https://api.github.com/repos/jroper/lagom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jroper/lagom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jroper/lagom/git/refs{/sha}","trees_url":"https://api.github.com/repos/jroper/lagom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jroper/lagom/statuses/{sha}","languages_url":"https://api.github.com/repos/jroper/lagom/languages","stargazers_url":"https://api.github.com/repos/jroper/lagom/stargazers","contributors_url":"https://api.github.com/repos/jroper/lagom/contributors","subscribers_url":"https://api.github.com/repos/jroper/lagom/subscribers","subscription_url":"https://api.github.com/repos/jroper/lagom/subscription","commits_url":"https://api.github.com/repos/jroper/lagom/commits{/sha}","git_commits_url":"https://api.github.com/repos/jroper/lagom/git/commits{/sha}","comments_url":"https://api.github.com/repos/jroper/lagom/comments{/number}","issue_comment_url":"https://api.github.com/repos/jroper/lagom/issues/comments{/number}","contents_url":"https://api.github.com/repos/jroper/lagom/contents/{+path}","compare_url":"https://api.github.com/repos/jroper/lagom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jroper/lagom/merges","archive_url":"https://api.github.com/repos/jroper/lagom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jroper/lagom/downloads","issues_url":"https://api.github.com/repos/jroper/lagom/issues{/number}","pulls_url":"https://api.github.com/repos/jroper/lagom/pulls{/number}","milestones_url":"https://api.github.com/repos/jroper/lagom/milestones{/number}","notifications_url":"https://api.github.com/repos/jroper/lagom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jroper/lagom/labels{/name}","releases_url":"https://api.github.com/repos/jroper/lagom/releases{/id}","deployments_url":"https://api.github.com/repos/jroper/lagom/deployments","created_at":"2016-03-10T00:47:27Z","updated_at":"2016-03-10T00:47:30Z","pushed_at":"2016-08-04T02:32:54Z","git_url":"git://github.com/jroper/lagom.git","ssh_url":"git@github.com:jroper/lagom.git","clone_url":"https://github.com/jroper/lagom.git","svn_url":"https://github.com/jroper/lagom","homepage":"","size":1530,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"lagom:master","ref":"master","sha":"da0c1115f2e3156a7223a487c718559c3fa4b267","user":{"login":"lagom","id":17168851,"avatar_url":"https://avatars.githubusercontent.com/u/17168851?v=3","gravatar_id":"","url":"https://api.github.com/users/lagom","html_url":"https://github.com/lagom","followers_url":"https://api.github.com/users/lagom/followers","following_url":"https://api.github.com/users/lagom/following{/other_user}","gists_url":"https://api.github.com/users/lagom/gists{/gist_id}","starred_url":"https://api.github.com/users/lagom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lagom/subscriptions","organizations_url":"https://api.github.com/users/lagom/orgs","repos_url":"https://api.github.com/users/lagom/repos","events_url":"https://api.github.com/users/lagom/events{/privacy}","received_events_url":"https://api.github.com/users/lagom/received_events","type":"Organization","site_admin":false},"repo":{"id":52320967,"name":"lagom","full_name":"lagom/lagom","owner":{"login":"lagom","id":17168851,"avatar_url":"https://avatars.githubusercontent.com/u/17168851?v=3","gravatar_id":"","url":"https://api.github.com/users/lagom","html_url":"https://github.com/lagom","followers_url":"https://api.github.com/users/lagom/followers","following_url":"https://api.github.com/users/lagom/following{/other_user}","gists_url":"https://api.github.com/users/lagom/gists{/gist_id}","starred_url":"https://api.github.com/users/lagom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lagom/subscriptions","organizations_url":"https://api.github.com/users/lagom/orgs","repos_url":"https://api.github.com/users/lagom/repos","events_url":"https://api.github.com/users/lagom/events{/privacy}","received_events_url":"https://api.github.com/users/lagom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lagom/lagom","description":"Reactive Microservices for the JVM","fork":false,"url":"https://api.github.com/repos/lagom/lagom","forks_url":"https://api.github.com/repos/lagom/lagom/forks","keys_url":"https://api.github.com/repos/lagom/lagom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lagom/lagom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lagom/lagom/teams","hooks_url":"https://api.github.com/repos/lagom/lagom/hooks","issue_events_url":"https://api.github.com/repos/lagom/lagom/issues/events{/number}","events_url":"https://api.github.com/repos/lagom/lagom/events","assignees_url":"https://api.github.com/repos/lagom/lagom/assignees{/user}","branches_url":"https://api.github.com/repos/lagom/lagom/branches{/branch}","tags_url":"https://api.github.com/repos/lagom/lagom/tags","blobs_url":"https://api.github.com/repos/lagom/lagom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lagom/lagom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lagom/lagom/git/refs{/sha}","trees_url":"https://api.github.com/repos/lagom/lagom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lagom/lagom/statuses/{sha}","languages_url":"https://api.github.com/repos/lagom/lagom/languages","stargazers_url":"https://api.github.com/repos/lagom/lagom/stargazers","contributors_url":"https://api.github.com/repos/lagom/lagom/contributors","subscribers_url":"https://api.github.com/repos/lagom/lagom/subscribers","subscription_url":"https://api.github.com/repos/lagom/lagom/subscription","commits_url":"https://api.github.com/repos/lagom/lagom/commits{/sha}","git_commits_url":"https://api.github.com/repos/lagom/lagom/git/commits{/sha}","comments_url":"https://api.github.com/repos/lagom/lagom/comments{/number}","issue_comment_url":"https://api.github.com/repos/lagom/lagom/issues/comments{/number}","contents_url":"https://api.github.com/repos/lagom/lagom/contents/{+path}","compare_url":"https://api.github.com/repos/lagom/lagom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lagom/lagom/merges","archive_url":"https://api.github.com/repos/lagom/lagom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lagom/lagom/downloads","issues_url":"https://api.github.com/repos/lagom/lagom/issues{/number}","pulls_url":"https://api.github.com/repos/lagom/lagom/pulls{/number}","milestones_url":"https://api.github.com/repos/lagom/lagom/milestones{/number}","notifications_url":"https://api.github.com/repos/lagom/lagom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lagom/lagom/labels{/name}","releases_url":"https://api.github.com/repos/lagom/lagom/releases{/id}","deployments_url":"https://api.github.com/repos/lagom/lagom/deployments","created_at":"2016-02-23T01:51:06Z","updated_at":"2016-08-03T03:08:17Z","pushed_at":"2016-08-04T02:32:54Z","git_url":"git://github.com/lagom/lagom.git","ssh_url":"git@github.com:lagom/lagom.git","clone_url":"https://github.com/lagom/lagom.git","svn_url":"https://github.com/lagom/lagom","homepage":"https://lightbend.com/lagom","size":1549,"stargazers_count":782,"watchers_count":782,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"open_issues_count":36,"forks":114,"open_issues":36,"watchers":782,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lagom/lagom/pulls/137"},"html":{"href":"https://github.com/lagom/lagom/pull/137"},"issue":{"href":"https://api.github.com/repos/lagom/lagom/issues/137"},"comments":{"href":"https://api.github.com/repos/lagom/lagom/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/lagom/lagom/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/lagom/lagom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lagom/lagom/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/lagom/lagom/statuses/1a35a8ce014552c9be9e361b31c273152a92298c"}}}}
{"actor":{"display_login":"dotta"}}