I have a very small class:
package group.hello;
public abstract class Test extends org.eclipse.ui.part.ViewPart { }
which I compile and package using a very small pom:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>group</groupId>
<artifactId>hello</artifactId>
<version>0</version>
<packaging>bundle</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>ui</artifactId>
<version>[3.4,4.0)</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
The generated MANIFEST.MF contains in this case "Import-Package:
group.hello,org.eclipse.ui.part" (seems very reasonable!)
Now, if I generate the Eclipse files with
>mvn clean package eclipse:clean eclipse:eclipse -Declipse.pde=true
install
and import the project in Eclipse 3.4, Eclipse complains:
- org.eclipse cannot be resolved to a type
- The type org.eclipse.core.commands.common.EventManager cannot be
resolved. It is indirectly referenced from required .class files
Moved by despair, I changed the scope of org.eclipse.ui to "compile";
MANIFEST.MF was then generated with "Import-Package:
group.hello,org.eclipse.ui.part;ui.workbench=split;" but Eclipse
complained more than before:
- The type org.eclipse.swt.graphics.Image cannot be resolved. It is
indirectly referenced from required .class files
- The type org.eclipse.core.runtime.IConfigurationElement cannot be
resolved. It is indirectly referenced from required .class files
- The type org.eclipse.jface.util.IPropertyChangeListener cannot be
resolved. It is indirectly referenced from required .class files
- The type org.eclipse.core.runtime.IAdaptable cannot be resolved. It is
indirectly referenced from required .class files
- The type org.eclipse.core.commands.common.EventManager cannot be
resolved. It is indirectly referenced from required .class files
- The type org.eclipse.swt.widgets.Composite cannot be resolved. It is
indirectly referenced from required .class files
- The type org.eclipse.core.runtime.IExecutableExtension cannot be
resolved. It is indirectly referenced from required .class files
I only can make Eclipse happy if I manually add either all the missing
packages (using <Import-Package>) or org.eclipse.ui (using
<Require-Bundle>). But since Require-Bundle should be avoided, and
Import-Package, according to the documentation, "rarely has to be
explicitly specified", I'd like to know the "right way" of changing my pom
in order to get a correct MANIFEST.MF.
(BTW: the two-line class was tailored from the Eclipse plugin template
"RCP application with a view")
Thanks
-- clovis
______________________________________
Diese E-Mail kann vertrauliche und geschuetzte Informationen enthalten. Wenn
diese E-Mail nicht für Sie bestimmt ist, bitten wir Sie, uns unverzueglich zu
informieren und sie zu loeschen.
This e-mail message may contain information, which is confidential and
protected. If you are not the intended recipient of this message, we ask you to
inform us immediately and delete the message afterwards.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]