title: Why doesn't swagger-maven-plugin find my API operation?
body: <p>I'm trying to setup API documentation using Swagger 2.0 and swagger-maven-plugin on a Spring Boot project. In my controller I use the io.swagger.v3.oas annotations:</p>
  
  <pre><code>import io.swagger.v3.oas.annotations.Operation;
  import io.swagger.v3.oas.annotations.Parameter;
  import io.swagger.v3.oas.annotations.media.Content;
  import io.swagger.v3.oas.annotations.media.Schema;
  import io.swagger.v3.oas.annotations.responses.ApiResponse;
  
  @RestController
  @RequestMapping("/api")
  public class CountryController {
  
      @Operation(summary = "Read country by ISO 3166-1 alpha-2 code", responses = {
          @ApiResponse(responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Country.class)))
      })
      @RequestMapping(value = { "/country/{key}" }, method = { RequestMethod.GET })
      @PreAuthorize("#oauth2.hasScope('read')")
      Country getCountry(
              @Parameter(name = "key", description = "The ISO 3166-1 alpha-2 code of the country") @PathVariable final String key,
              @Parameter(hidden = true) final Principal principal) {
      return countryService.load(key, UserInSession.fromPrincipal(principal, userDetailsService))
          .orElse(null);
      }
  }
  </code></pre>
  
  <p>And in my pom.xml</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;com.github.kongchen&lt;/groupId&gt;
              &lt;artifactId&gt;swagger-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${swagger-maven-plugin-version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;apiSources&gt;
                      &lt;apiSource&gt;
                          &lt;springmvc&gt;true&lt;/springmvc&gt;
                          &lt;locations&gt;
                              &lt;location&gt;ch.want.funnel.controller&lt;/location&gt;
                          &lt;/locations&gt;
                          &lt;schemes&gt;
                              &lt;scheme&gt;http&lt;/scheme&gt;
                              &lt;scheme&gt;https&lt;/scheme&gt;
                          &lt;/schemes&gt;
                          &lt;host&gt;www.funnel.travel&lt;/host&gt;
                          &lt;basePath&gt;/api&lt;/basePath&gt;
                          &lt;info&gt;
                              &lt;title&gt;funnel.travel API&lt;/title&gt;
                              &lt;version&gt;${project.version}&lt;/version&gt;
                              &lt;description&gt;
                                  API document for funnel.travel server
                              &lt;/description&gt;
                              &lt;termsOfService&gt;http://www.funnel.travel/license.html&lt;/termsOfService&gt;
                              &lt;contact&gt;
                                  &lt;email&gt;info@funnel.travel&lt;/email&gt;
                                  &lt;name&gt;Simon Niederberger&lt;/name&gt;
                                  &lt;url&gt;http://www.funnel.travel&lt;/url&gt;
                              &lt;/contact&gt;
                              &lt;license&gt;
                                  &lt;url&gt;http://www.funnel.travel/license.html&lt;/url&gt;
                                  &lt;name&gt;Commercial, all rights reserved&lt;/name&gt;
                              &lt;/license&gt;
                          &lt;/info&gt;
                          &lt;securityDefinitions&gt;
                              &lt;securityDefinition&gt;
                                  &lt;name&gt;funnel OAuth&lt;/name&gt;
                                  &lt;type&gt;oauth2&lt;/type&gt;
                                  &lt;name&gt;Authorization&lt;/name&gt;
                                  &lt;in&gt;header&lt;/in&gt;
                              &lt;/securityDefinition&gt;
                          &lt;/securityDefinitions&gt;
                          &lt;outputPath&gt;${basedir}/generated/document.html&lt;/outputPath&gt;
                          &lt;swaggerDirectory&gt;${basedir}/generated/swagger-ui&lt;/swaggerDirectory&gt;
                          &lt;!-- &lt;swaggerApiReader&gt;com.wordnik.swagger.jaxrs.reader.DefaultJaxrsApiReader&lt;/swaggerApiReader&gt; --&gt;
                          &lt;attachSwaggerArtifact&gt;true&lt;/attachSwaggerArtifact&gt;
                      &lt;/apiSource&gt;
                  &lt;/apiSources&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;compile&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
     ...
      &lt;dependency&gt;
          &lt;groupId&gt;io.swagger.core.v3&lt;/groupId&gt;
          &lt;artifactId&gt;swagger-core&lt;/artifactId&gt;
          &lt;version&gt;2.0.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>From the maven log I see that the ch.want.funnel.controller package is scanned, but only API paths for /login and /error are generated! Am I missing an annotation or plugin-configuration?</p>
  
  <p>I'd rather not switch to springfox, as I prefer generating the swagger.json at compile-time.</p>
  
  <p>Thanks, Simon</p>