avaje / avaje-inject

Dependency injection via APT (source code generation) ala "Server-Side Dagger DI"
https://avaje.io/inject
Apache License 2.0
227 stars 21 forks source link

Make Annotations Source Retention #631

Closed SentryMan closed 2 months ago

SentryMan commented 2 months ago

Change annotations to have Class retention with the exception of:

The reason for these exceptions is that for APM (Application Performance Monitoring) tools like avaje-metrics detect and enhance with timing all public methods of all @Component / @Singleton. Lifecycle methods annotated with @PreDestroy/ @PostConstruct typically get excluded by default from APM so we need to detect those as well.

Note that if projects need some of these annotations to have RUNTIME or CLASS retention then please log an issue with the use case that you need to support - thanks.

rob-bygrave commented 2 months ago

Some of these annotations are used for APM - Application Performance Monitoring. For example, they are detected by avaje-metrics to enhance which can timing metrics to all public methods of all @Component, @Singleton etc and typically excluding @PostConstruct. So no, we can't make them all SOURCE retention.

rbygrave commented 2 months ago

We can re-open this, I can go through and change the ones we want to keep at RUNTIME. I'll reopen for now.