eclipse-sisu / sisu-project

Sisu Inject
https://www.eclipse.org/sisu
Eclipse Public License 2.0
17 stars 15 forks source link

PreConstruct PreDestroy should be own annotations #58

Closed cstamas closed 1 year ago

cstamas commented 2 years ago

Just like Description, and sisu should stop pulling in "unpopular" dependencies like javax stuff for only those two annotations. Maybe make the behave in similar way how Sisu;s Nullable is working (annotation from several packages are all recognized as Nullable annotation)

cstamas commented 1 year ago

Example (but builds on my another PR to be able to build SISU on Java17): https://github.com/cstamas/sisu.inject/pull/1

The PR the example PR is made against: https://github.com/eclipse/sisu.inject/pull/61

cstamas commented 1 year ago

In short, this would allow users of sisu (like Maven) to not include jsr250 annotations on CP, but directly use SISU annotations, just the very same way as with Typed, Priority or Nullable

mcculls commented 1 year ago

Good idea, thanks for the example

cstamas commented 1 year ago

The indirect goal of this issue is targeting Maven: goal is to remove the annotation dependencies from Maven Core, as that caused troubles in past (leakage), but also confuses developers that Maven is full CDI, which is not.

Sisu is really "internal detail" of Maven, so Maven (internally) should use Sisu specific lifecycle annotations (as they are used in Maven Core already), and not JSR250 annotations, as that just spreads confusion among other devs.