I'm using Eclipse 4.3
Create an blank plugin "plugin1", then a second plugin "plugin2" that depends on "plugin1" (plugin dependence).
In some class in plugin1 (say, Activator) create a method
public static void sayHi() {
System.out.println("plugin1 says hi");
}
Create a class in plugin2 that calls that:
public class Class1 {
@Test
public void mytest() {
plugin1.Activator.sayHi();
}
public static void main(String[] args) {
(new Class1()).mytest();
}
}
Test that it runs ok, as Java app and as Junit test
Then generate a ANT build.xml for plugin2:
plugin2 -> Export -> General -> Ant BuildFiles
Open the generated build.xml and try to run the Class1 target (either as Java app, or a Junit test). It fails java.lang.NoClassDefFoundError: plugin1/Activator
Looking inside the build.xml
<path id="Plug-in Dependencies.libraryclasspath">
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ui_3.105.0.v20130522-1122.jar"/>
....
<pathelement location="../../../../plugin1"/>
</path>
That last entry looks totally wrong (it misses the "bin/" and it can't imagine what's it's being relative to). If I manually change it to the logical "../plugin1/bin"
<pathelement location="../..plugin1/bin"/>
then it works ok.
Do you think this a bug?