2
maven依存関係を使用する別のスプリングブートアプリケーション内でjarファイルとしてSpringブートプロジェクトを使用しています。私は、マイクロサービスからカスタム注釈を有効にする場合にのみjarのコンポーネントスキャンを実行したいと思います。カスタム注釈を使用したコンポーネントスキャン
@SpringBootApplication
//@ComponentScan({"com.jwt.security.*"}) To be removed by custom annotation
@MyCustomAnnotation //If I provide this annotation then the security configuration of the jar should be enabled.
public class MicroserviceApplication1 {
public static void main(String[] args) throws Exception {
SpringApplication.run(MicroserviceApplication1.class, args);
}
}
いくつか考えてください。
私はあなたが共有したいコードをリファクタリングして別のプロジェクトを作ることを提案します...マイクロサービスの世界で一般的な共有コードとは別に悪い考えです...モノレポの設定が必要です。 – khmarbaise
どうやってこれを実装しましたか? –