Go to Edit Configurations -> Modify Options -> Add VM Options:
Put the full path of the javaagent for new relic, newrelic.jar file. Make sure that your newrelic.yml file is in the same folder that the newrelic.jar file.
then run your spring app and it will use new relic agent: Running app