May 1, 2010 by andre.kullmann
Posted in
Hi,
I try to build an simple exapmle feature.
The first Plugin in my feature imports three packages
MANIFEST.MF
[..]
Import-Package: com.company.core, org.eclipse.jface.text, org.objectweb.asm.util;version="3.2.0"
The first package is expoted by the second plugin in the feature.
The second package is exported by jface. Target Platform.
The last package is exported by asm located in the target platform.
The ant4 eclipse build failed ...
[javac] 3. ERROR in C:\Av\test_workspace\com.company.ui\src\com\company\ui\Client.java (at line 24) [javac] IDocument document = null; [javac] ^^^^^^^^^ [javac] IDocument cannot be resolved to a type [javac] ----------
It looks like the org.eclipse.jface.text will not be available at compile time.
The other two packages will imported correctly.
Is this an known problem ?
Regards,
André
- Login to post comments
Split package...
Hi André,
that's an interesting case! The package 'org.eclipse.jface.text' is a so called split package, it is contained in the bundle 'org.eclipse.jface.text' as well as in bundle 'org.eclipse.text'.
From an OSGi point of view it is not possible to deal with split packages if you use 'Import-Package'. In this case, only one fragment of the package (EITHER from 'org.eclipse.jface.text' OR from 'org.eclipse.text') will be wired to the importer. You have to use 'Require-Bundle' to wire both package fragments to the importer...
The funny thing is that the PDE adds both plugins to the plug-in dependencies if you specify 'Import-Package: org.eclipse.jface.text'. From my understanding, this is wrong, because it does not reflect the runtime behaviour of the OSGi runtime...
I'm not sure how we (=ant4eclipse ;-)) should handle these cases... any thoughts?
Regards,
Gerd
Hello Gerd, the Equinox-
Hello Gerd,
the Equinox- Runtime supports this kind of Import Statements. After compiling my example with PDE it works fine with Eclipse
3.5 and 3.6. I think ant4eclipse should do it like pde and import all matching packages. Because it's called ant4eclipse not ant4osgi :-)
Regards,
André
Just my two cents
Hi there,
Regarding your comment about the name ant4eclipse you're probably right.
Nevertheless I personally would like to object as the concept of split packages is considered an architectural smell by me (it increases the complexity without being worth the effort).
If Gerd decides to realize this I would suggest that this will be done on demand only (f.e. through some kind of switch).
I personally always want to have the possibility to make the code runnable in other OSGi runtimes, so I don't want my own codes messed up with such techniques.
Best regards
Daniel Kasmeroglu
Hi, Has this issue been fixed
Hi,
Has this issue been fixed now or is there some workaround for it?
I am trying to import org.eclipse.ui.texteditor.ITextEditor and facing this error. I am able to build my component with Eclipse, but with ant4eclipse I receive error: "The import org.eclipse.ui.texteditor.ITextEditor cannot be resolved."
I have tried both, setting org.eclipse.jface.text as import package and setting org.eclipse.ui.editors as Reguire-Bundle, but same happens in both cases...