title: Generate swagger JSON file at compile time for springfox based project
body: <p>I have working project which is using springfox to generate API documentations. </p>
  
  <p>I want to generate swagger.json at <strong>compile time</strong>. </p>
  
  <p>following is sample springfox configuration, </p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfig {
      @Bean
      public Docket productApi() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()                 
                  .apis(RequestHandlerSelectors.basePackage("com.abc.xyz"))
                  .paths(regex("/*.*"))
                  .build();
      }
  }
  </code></pre>
  
  <p><em>FYI : I have also tried <a href="https://github.com/kongchen/swagger-maven-plugin" rel="noreferrer">https://github.com/kongchen/swagger-maven-plugin</a> plugin but it's not working</em></p>