title: Project running successfully using maven but failing while running with intellij
body: <p>I am creating a managed object inside App.java (which is the main class of my module). I am using guice library with dropwizard framework and getting this exception only when running with IntelliJ if I run the same code with mvn it works perfectly fine which is weird and beyond my theory. So if someone has experienced something like this or have some theory behind this then please share. feel free to ask any detail.</p>
  
  <pre><code>   environment.lifecycle().manage(new Managed() {
          @Override
          public void start() throws Exception {
          }
  
          @Override
          public void stop() throws Exception {
          }
      });
  </code></pre>
  
  <p>Exception stacktrace:- </p>
  
  <pre><code>  Exception in thread "main" com.google.inject.CreationException: Unable to create injector, see the following errors:
  
          1) Injecting into inner classes is not supported.  Please use a 'static' class (top-level or nested) instead of com.phonepe.growth.App$4.
          at ru.vyarus.dropwizard.guice.module.installer.InstallerModule.bindExtension(InstallerModule.java:191) (via modules: ru.vyarus.dropwizard.guice.module.GuiceSupportModule -&gt; ru.vyarus.dropwizard.guice.module.installer.InstallerModule)
  
          1 error
          at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
          at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
          at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
          at com.google.inject.Guice.createInjector(Guice.java:99)
          at ru.vyarus.dropwizard.guice.injector.DefaultInjectorFactory.createInjector(DefaultInjectorFactory.java:20)
          at ru.vyarus.dropwizard.guice.GuiceBundle.createInjector(GuiceBundle.java:191)
          at ru.vyarus.dropwizard.guice.GuiceBundle.run(GuiceBundle.java:138)
          at ru.vyarus.dropwizard.guice.GuiceBundle.run(GuiceBundle.java:93)
          at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:200)
          at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
          at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
          at io.dropwizard.cli.Cli.run(Cli.java:75)
          at io.dropwizard.Application.run(Application.java:79)
          at com.phonepe.growth.App.main(App.java:48)
  </code></pre>