Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Does "Export-Package: ." Mean?

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
like image 577
Marteng Avatar asked Mar 12 '26 10:03

Marteng


2 Answers

. 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
like image 121
howlger Avatar answered Mar 13 '26 22:03

howlger


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.

like image 42
greg-449 Avatar answered Mar 14 '26 00:03

greg-449



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!