Искам да опаковам буркан на трета страна. За съжаление доставчикът постави един единствен клас (a.class) с един единствен метод в пакета по подразбиране.
Когато се опитам да включа ресурса с помощта на Include-Resource: @lib/acme-8.0.jar
, това води до следната грешка:
The default package '.' is not permitted by the Import-Package syntax.
This can be caused by compile errors in Eclipse because Eclipse creates valid class files regardless of compile errors.
The following package(s) import from the default package [com.acme.util]
bnd print -all acme-8.0.jar
ми дава следния изход (съкратено, името на доставчика е заменено с acme)
[API USES]
. []
com.acme.common []
com.acme.acmedrt [com.acme.acmedrt.types, com.acme.acmedrt.comm.jobtransport, com.acme.acmedrt.workflow.type
s]
com.acme.acmedrt.impl [com.acme.acmedrt, com.acme.acmedrt.types, org.apache.commons.logging, com.acme.acmedrt.imp
l.types, com.acme.acmedrt.comm.jobtransport, com.acme.acmedrt.pool, org.apache.commons.pool, com.acme.acmedrt.workflow.types]
com.acme.acmedrt.impl.types [com.acme.acmedrt.types, com.acme.acmedrt, com.acme.acmedrt.impl, org.xml.sax]
com.acme.acmedrt.notification [com.acme.acmedrt]
com.acme.acmedrt.pool [com.acme.acmedrt, com.acme.acmedrt.impl.types, com.acme.acmedrt.impl, com.acme.acmedrt.types,
org.apache.commons.pool, com.acme.acmedrt.workflow.types]
com.acme.acmedrt.types [com.acme.acmedrt, com.acme.common]
com.acme.acmedrt.util []
com.acme.acmedrt.workflow.types [com.acme.common]
com.acme.tools []
com.acme.util []
com.acme.util.xml []
[LIST]
a.class
META-INF
MANIFEST.MF
com
com <no contents>
com/acme
com/acme <no contents>
com/acme/common
Enum.class
com/acme/acmedrt
[...]
Ако разбирам правилно този изход, няколко пакета използват пакета по подразбиране. Как изобщо е възможно това? Доколкото знам, не можете да импортирате класове от пакета по подразбиране.
Вече се свързах с доставчика с молба за преместване на класа в нарушение. Вероятно той няма да последва предложението ми.
Има ли заобиколно решение за обработка на класове в пакета по подразбиране?