On 2018-03-22T12:40:33 +0000 "Thomas Watson" <[email protected]> wrote:
> The @Component annotation is not a runtime annotation so I am not sure why a
> JPMS module with classes annotated with @Component (or other Declarative
> Service annotations) would need a requirement on another module that exports
> the package org.osgi.service.component.annotations. That package should not
> be needed at all at runtime.
>
Hello!
You're right in that it's not required at runtime, but you still have
to specify a "requires" clause in the containing module in order to be
able to compile code that uses the annotation:
module example {
requires static org.osgi.service.component.annotations;
}
You actually can write the above today, but only because of the way the
org.osgi.service.component.annotations jar is named: The algorithm that
determines the automatic module name from the jar comes up with the
module name you'd probably want to use anyway. You'll still get loud
warnings from build tools though:
[WARNING] * Required filename-based automodules detected. Please
don't publish this project to a public artifact repository! *
--
Mark Raynsford | http://www.io7m.com
pgpCc9enz0uJF.pgp
Description: OpenPGP digital signature
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
