Imagine an Eclipse plug-in (resp. OSGi bundle) with a package org.acme.foo.bar.
It's possible to export "." e.g. see the following MANIFEST.MF snippet:
Export-Package: .,
org.acme.foo.bar
Compiler has no problems with that so it seems to be a legit export.
What does it do? What is the difference to the following ("." not exported)?
Export-Package: org.acme.foo.bar
. is the default package but according to the OSGi Core, Release 6 specification . is not a valid value for Export-Package because a package name must start with a letter:
Export-Package ::= export ( ',' export)*
export ::= package-names ( ';' parameter )*
package-names ::= package-name ( ';' package-name )*
package-name ::= unique-name
unique-name ::= identifier ( '.' identifier )*
identifier ::= jletter jletterordigit *
jletter ::= <see Java Language Specification Third Edition for JavaLetter>
jletterordigit ::= <see Java Language Specification Third Edition for JavaLetterOrDigit>
It would therefore be better to do without a default package:
Export-Package: org.acme.foo.bar
Although the Eclipse MANIFEST.MF validation allows '.' it isn't valid according to the OSGi specification. It seems to mean the default package, but this isn't a sensible thing to export.
This appears to be confirmed by Eclipse bug 366800 which reported the use of a '.' like this in the 'org.eclipse.datatools.sqltools.parsers.sql.query' plugin. The bug was accepted as a error and the '.' removed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With