{"action":"opened","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/5465","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/5465/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/5465/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/5465/events","html_url":"https://github.com/spring-projects/spring-boot/issues/5465","id":142970797,"number":5465,"title":"Add warning message when no candidates found in EnableAutoConfigurationImportSelector","user":{"login":"rob-baily","id":8356916,"avatar_url":"https://avatars.githubusercontent.com/u/8356916?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-baily","html_url":"https://github.com/rob-baily","followers_url":"https://api.github.com/users/rob-baily/followers","following_url":"https://api.github.com/users/rob-baily/following{/other_user}","gists_url":"https://api.github.com/users/rob-baily/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-baily/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-baily/subscriptions","organizations_url":"https://api.github.com/users/rob-baily/orgs","repos_url":"https://api.github.com/users/rob-baily/repos","events_url":"https://api.github.com/users/rob-baily/events{/privacy}","received_events_url":"https://api.github.com/users/rob-baily/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-23T14:14:54Z","updated_at":"2016-03-23T14:14:54Z","closed_at":null,"body":"I was working with someone trying to use Spring Boot with AWS Lambda (maybe not the best choice so don't worry about that) and he was having trouble getting the injection to work.  See http://stackoverflow.com/questions/36081908/using-spring-boot-cloud-with-amazon-aws-lambda-does-not-inject-values/ for reference.    It turns out that he was using the Maven Shade plugin (this is what the Lambda documentation generally suggests) and that plugin was rearranging the spring.factories file used in META-INF so the SpringFactoriesLoader.loadFactoryNames was returning an empty list.  The application was unable to do any auto configuration which also had an issue with properties being replaced in Value annotations.\r\n\r\nThis was very tricky to find out so what I think makes sense is to add a warning or error.  Currently in the EnableAutoConfigurationImportSelector there is an assertion of the AnnotationAttributes not being null.  In this case that value is not null but what is loaded from the SpringFactoriesLoader is an empty list.  I would like to propose that either an assertion is added or a warning or error is logged.  I can't think of a use case where you enable auto configuration for Spring Boot and validly have no factories configured.  I think an assertion might be best but would welcome feedback from the team.\r\n\r\nI can create the pull request for this based on feedback on which way to go.  Also I don't know how to write a test case for this since it involves changing the spring.factories file somehow and that seems to be at too low of a level.  If you have any suggestions on how "}}