title: How to make JHipster 'hot reload' classes
body: <p>I'm using default generated jhipster application and I'm wondering how to make it 'hot reload' using spring-boot-devtools. </p>
  
  <p>That's how I tried to start this application in 2 different ways:
  <a href="http://prntscr.com/a4dhmu" rel="nofollow">http://prntscr.com/a4dhmu</a> or <a href="http://prntscr.com/a4di2c" rel="nofollow">http://prntscr.com/a4di2c</a></p>
  
  <p>spring-boot-devtools library is included in dev profile (just simple generated pom.xml) and my Application.class is default:</p>
  
  <pre><code>package com.testnewfeatures.app;
  
  import com.testnewfeatures.app.config.Constants;
  import com.testnewfeatures.app.config.JHipsterProperties;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration;
  import org.springframework.boot.actuate.autoconfigure.MetricRepositoryAutoConfiguration;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
  import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
  import org.springframework.boot.context.properties.EnableConfigurationProperties;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.core.env.Environment;
  import org.springframework.core.env.SimpleCommandLinePropertySource;
  
  import javax.annotation.PostConstruct;
  import javax.inject.Inject;
  import java.io.IOException;
  import java.net.InetAddress;
  import java.net.UnknownHostException;
  import java.util.Arrays;
  import java.util.Collection;
  
  @ComponentScan
  @EnableAutoConfiguration(exclude = { MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class, HazelcastAutoConfiguration.class })
  @EnableConfigurationProperties({ JHipsterProperties.class, LiquibaseProperties.class })
  public class Application {
  
  private static final Logger log = LoggerFactory.getLogger(Application.class);
  
  @Inject
  private Environment env;
  
  /**
   * Initializes TestNewFeatures.
   * &lt;p/&gt;
   * Spring profiles can be configured with a program arguments --spring.profiles.active=your-active-profile
   * &lt;p/&gt;
   * &lt;p&gt;
   * You can find more information on how profiles work with JHipster on &lt;a href="http://jhipster.github.io/profiles.html"&gt;http://jhipster.github.io/profiles.html&lt;/a&gt;.
   * &lt;/p&gt;
   */
  @PostConstruct
  public void initApplication() throws IOException {
      if (env.getActiveProfiles().length == 0) {
          log.warn("No Spring profile configured, running with default configuration");
      } else {
          log.info("Running with Spring profile(s) : {}", Arrays.toString(env.getActiveProfiles()));
          Collection&lt;String&gt; activeProfiles = Arrays.asList(env.getActiveProfiles());
          if (activeProfiles.contains(Constants.SPRING_PROFILE_DEVELOPMENT) &amp;&amp; activeProfiles.contains(Constants.SPRING_PROFILE_PRODUCTION)) {
              log.error("You have misconfigured your application! " +
                  "It should not run with both the 'dev' and 'prod' profiles at the same time.");
          }
          if (activeProfiles.contains(Constants.SPRING_PROFILE_PRODUCTION) &amp;&amp; activeProfiles.contains(Constants.SPRING_PROFILE_FAST)) {
              log.error("You have misconfigured your application! " +
                  "It should not run with both the 'prod' and 'fast' profiles at the same time.");
          }
          if (activeProfiles.contains(Constants.SPRING_PROFILE_DEVELOPMENT) &amp;&amp; activeProfiles.contains(Constants.SPRING_PROFILE_CLOUD)) {
              log.error("You have misconfigured your application! " +
                  "It should not run with both the 'dev' and 'cloud' profiles at the same time.");
          }
      }
  }
  
  /**
   * Main method, used to run the application.
   */
  public static void main(String[] args) throws UnknownHostException {
      SpringApplication app = new SpringApplication(Application.class);
      SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args);
      addDefaultProfile(app, source);
      Environment env = app.run(args).getEnvironment();
      log.info("Access URLs:\n----------------------------------------------------------\n\t" +
              "Local: \t\thttp://127.0.0.1:{}\n\t" +
              "External: \thttp://{}:{}\n----------------------------------------------------------",
          env.getProperty("server.port"),
          InetAddress.getLocalHost().getHostAddress(),
          env.getProperty("server.port"));
  
  }
  
  /**
   * If no profile has been configured, set by default the "dev" profile.
   */
  private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
      if (!source.containsProperty("spring.profiles.active") &amp;&amp;
              !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
  
          app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
      }
  }
  }
  </code></pre>
  
  <p>I'm doing something wrong becaus 'Hot reload' doesn't appear when I change any class.</p>
  
  <p>Thanks!</p>