title: List all my beans loaded by SpringApplication.run
body: <p>I am trying to enlist all the beans written by me when I boot up the SpringApplication. </p>
  
  <p>Getting <em>all</em> the beans listed is done. This code does it. </p>
  
  <pre><code>String[] beanNames = appContext.getBeanDefinitionNames();
  
  Arrays.sort(beanNames);
  for (String beanName : beanNames) {
          System.out.println(beanName);
  }
  </code></pre>
  
  <p>I tried using a basic filter to look for <em>my stuff</em>. </p>
  
  <pre><code>String[] beanNames = appContext.getBeanDefinitionNames();
  
  Arrays.sort(beanNames);
  for (String beanName : beanNames) {
      if (beanName.matches("(.*)Controller"))
          System.out.println(beanName);
  }
  </code></pre>
  
  <p>But that does not work because when the classes are loaded it is really the bean name that is loaded and not the exact name of the classes. So if I wrote a <em>my.personal.package.structure.MyController</em> it would most probably show up as <em>myController</em>. The package structure information is lost rendering this technique, not quite effective. </p>
  
  <p>Has anyone tried some other way that worked. I expect this to be very handy for a developer for debugging. </p>