glassfish-hk2
glassfish-hk2 copied to clipboard
hk2-config missing from published maven artifacts
I was trying to use the latest version of HK2 (2.5.0-b61) but was having trouble resolving the @ConfiguredBy annotation. Turns out the hk2-config (and config-types) artifacts don't appear to exist in recent releases.
It existed in this release - https://mvnrepository.com/artifact/org.glassfish.hk2/hk2/2.5.0-b56 But is missing starting in this release and going forward - https://mvnrepository.com/artifact/org.glassfish.hk2/hk2/2.5.0-b57
- Issue Imported From: https://github.com/javaee/hk2/issues/380
- Original Issue Raised By:@rgenna-oracle
- Original Issue Assigned To: @romain-grecourt
@rgenna-oracle Commented It turns out the hk2-config jar wasn’t what I actually wanted to locate the proper @ConfiguredBy & @Configured annotations. The hk2-config jar does contain classes with those names but they are in the “org.jvnet.hk2.config” package, not the “org.glassfish.hk2.configuration.api” package. The “hk2-configuration-integration” is the jar which contains the correct classes, but the high level hk2 pom doesn’t pull that in.
Note, I'm working based on this example: https://javaee.github.io/hk2/configuration-example.html
@romain-grecourt Commented "hk2-config" is the old config sub-system used by GlassFish. It was moved to the GF workspace some time ago.
I guess the action item is to document the required dependencies.
@rgenna-oracle Commented I guess the part that was confusing was that the configuration-example doesn't tell you that you need to bring in an additional dependency in order to resovle the configuration related annotations. When using an older version of the hk2 high level pom.xml it pulled in the hk2-config aritfact which contained those annotations, but they were the wrong ones which was confusing. The newer version of hk2 doesn't have that dependency, which is fine if that's intentional, but I would think either the high level hk2 pom should pull in the hk2-configuration-integration as a dependency since, according do the docs "The org.glassfish.hk2:hk2 dependency has a dependency on all of the HK2 jars.", or it should be clearer in the documenation that if you're looking to work with the configuration related annotations you'll need this additional "hk2-configuration-integration" dependency in your build and runtime.