Hi all, I created a new binding, and it can be built severaly days before. But today when I tried to build it with mvn clean install
, a strange error happened, which is shown as below.
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.7:verify (karaf-feature-verification) on project org.openhab.binding.mylogger: Feature resolution failed for [openhab-binding-mylogger/2.5.0.SNAPSHOT]
Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-mylogger; type=karaf.feature; version=2.5.0.SNAPSHOT; filter:=â(&(osgi.identity=openhab-binding-mylogger)(type=karaf.feature)(version>=2.5.0.SNAPSHOT))â [caused by: Unable to resolve openhab-binding-mylogger/2.5.0.SNAPSHOT: missing requirement [openhab-binding-mylogger/2.5.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.mylogger; type=osgi.bundle; version=â[2.5.0.202001041605,2.5.0.202001041605]â; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.mylogger/2.5.0.202001041605: missing requirement [org.openhab.binding.mylogger/2.5.0.202001041605] osgi.wiring.package; filter:=â(osgi.wiring.package=org.openhab.core.automation)â]]
I actually implemented a component, which is used for outputing all rules. Here is my code.
@NonNullByDefault
@Component(immediate = true)
public class RuleCapture {private @NonNullByDefault({}) RuleRegistry Ruleservice; private final Logger logger = LoggerFactory.getLogger(RuleCapture.class); @Reference public void setService(RuleRegistry Ruleservice) { this.Ruleservice = Ruleservice; } @Activate public void activate(BundleContext context) { getAllRules(); } public void getAllRules() { Collection<Rule> rules = Ruleservice.getAll(); logger.info("The size is {}", rules.size()); for (Rule rule : rules) { logger.info("Current rule UID: {} name: {} tag: {} Description: {}", rule.getUID(), rule.getName(), rule.getTags(), rule.getDescription()); } /* For further exploration of rules, please refer to the Rule interface. */ }
}
To do that, I need to import some packages, which are related to org.openhab.core.automation.
import org.openhab.core.automation.Rule;
import org.openhab.core.automation.RuleRegistry;
However it can be built several days before, today it can not be built and the error messages seem to tell me that, the karaf-maven-plugin tries to verify the automation component, but it can not find it. I didnât import any core component in my current workspace, because I thought the openhab internal pom files and maven will help me do this automatically. What happened? Can anyone tell me? I donât know how to solve it.