Я хочу обернуть стороннюю банку. К сожалению, поставщик поместил один единственный класс (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
[...]
Если я правильно понимаю этот вывод, несколько пакетов используют пакет по умолчанию. Как это вообще возможно? Насколько я знаю, вы не можете импортировать классы из пакета по умолчанию.
Я уже связался с продавцом с просьбой перенести класс-нарушитель. Скорее всего, он не последует моему предложению.
Есть ли обходной путь для обработки классов в пакете по умолчанию?