{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/221","labels_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/221/comments","events_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/221/events","html_url":"https://github.com/cloudfoundry/java-buildpack/issues/221","id":103304313,"number":221,"title":"Override New Relic agent configuration from User-Provided Service payload with user defined JAVA_OPTS","user":{"login":"bryancuster","id":8812013,"avatar_url":"https://avatars.githubusercontent.com/u/8812013?v=3","gravatar_id":"","url":"https://api.github.com/users/bryancuster","html_url":"https://github.com/bryancuster","followers_url":"https://api.github.com/users/bryancuster/followers","following_url":"https://api.github.com/users/bryancuster/following{/other_user}","gists_url":"https://api.github.com/users/bryancuster/gists{/gist_id}","starred_url":"https://api.github.com/users/bryancuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryancuster/subscriptions","organizations_url":"https://api.github.com/users/bryancuster/orgs","repos_url":"https://api.github.com/users/bryancuster/repos","events_url":"https://api.github.com/users/bryancuster/events{/privacy}","received_events_url":"https://api.github.com/users/bryancuster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-26T15:53:50Z","updated_at":"2015-08-27T09:22:23Z","closed_at":null,"body":"As a follow up to https://github.com/cloudfoundry/java-buildpack/issues/173, it would be valuable for the new_relic_agent framework to look at the current JAVA_OPTS, and only add to the configuration map if the key is _not_ already defiened. This would allow users to override values if they desire. \r\n\r\nSomething along the lines of:\r\n\r\n```\r\ndef apply_user_configuration(credentials, configuration, java_opts)\r\n    credentials.each do |key, value|\r\n        configuration[key] = value unless java_opts.contains_system_property(\"newrelic.config.#{key}\")\r\n    end\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/comments/135360656","html_url":"https://github.com/cloudfoundry/java-buildpack/issues/221#issuecomment-135360656","issue_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/221","id":135360656,"user":{"login":"cgfrost","id":166104,"avatar_url":"https://avatars.githubusercontent.com/u/166104?v=3","gravatar_id":"","url":"https://api.github.com/users/cgfrost","html_url":"https://github.com/cgfrost","followers_url":"https://api.github.com/users/cgfrost/followers","following_url":"https://api.github.com/users/cgfrost/following{/other_user}","gists_url":"https://api.github.com/users/cgfrost/gists{/gist_id}","starred_url":"https://api.github.com/users/cgfrost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgfrost/subscriptions","organizations_url":"https://api.github.com/users/cgfrost/orgs","repos_url":"https://api.github.com/users/cgfrost/repos","events_url":"https://api.github.com/users/cgfrost/events{/privacy}","received_events_url":"https://api.github.com/users/cgfrost/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T09:22:23Z","updated_at":"2015-08-27T09:22:23Z","body":"Hi, thanks for raising this issue. Could you expand in the use case a little, why do you want existing `JAVA_OPTS` to win over user provided service credentials? If we do this then obviously the code is very simple but we would also need to print out warning messages saying which service credentials were ignored otherwise it could get confusing for users.\r\n\r\nTracker issue here: https://www.pivotaltracker.com/story/show/102143072"}}