I was following this Bndtools tutorial http://bndtools.org/tutorial.html to implement a simple greeting service.
First, I created this interface in bundle org.example.api
:
package org.example.api;
public interface Greeting {
String sayHello( String name );
}
Then a service that implements the above interface in bundle org.example.impl
:
package org.example.impl;
import org.osgi.service.component.annotations.Component;
@Component
public class GreetingComponent implements Greeting {
public String sayHello( String name ) {
return "Hello " + name;
}
}
Of course, the type Greeting
cannot be resolved. And here comes my question: what is the designated way to add the package import declaration to the impl
bundle? I am aware that I could manually edit bnd.bnd
of org.example.impl
to include the necessary package in the -buildpath
directive.
But that is rather inconvenient: memorize the package name, navigate to the appropriate bnd file, edit the directive, save. Isn't here a more convenient way to add the missing import?
I was looking for something like a quick fix (Ctrl+1) but that doesn't seem to exist.