title: How can I mark a Bean as deprecated in Spring / Kotlin
body: <p>In my codebase I currently have a restTemplate bean and a WebClient bean.
  I would like to mark the restTemplate as deprecated as we want to progressively move away from it.</p>
  
  <p>I have my 2 beans in my Configuration file:</p>
  
  <pre><code>    @Deprecated(message = "Please use WebClient instead")
      @Bean
      fun restTemplate(): RestTemplate =
          RestTemplateBuilder()
                  .requestFactory { HttpComponentsClientHttpRequestFactory() }
                  .build()
  
      @Bean
      fun baseWebClient(): WebClient =
          WebClient.builder().build()
  </code></pre>
  
  <p>However, when I autowire a RestTemplate, I don't see any deprecated warnings</p>
  
  <p>How can I achieve that?</p>