Adding my own dependency did not work

Hi,

i need some help adding my own dependency to my new binding.

Currently i’m writing a new binding. For the new binding a need a special dependency to https://mvnrepository.com/artifact/com.microsoft.signalr/signalr/3.1.2.

I’m adding the dependency to my pom.xml:

com.microsoft.signalr signalr 3.1.2

Now i got the following error while i’m building my project:

The default package ‘.’ is not permitted by the Import-Package syntax.

Can anyone please help me? I’m not an expert in maven dependency :frowning:

BR
Christian

Can you commit your code to GitHub? I guess the problem is in one of your own files. In most cases there are Java classes which are not in a package.

From my perspective problem is not related to dependency itself but OSGi manifest.

The . package is not used anywhere (it is invalid pkg). Have you modified any of bnd files, maven pom or project properties there?
It is also possible that microsoft lib has an invalid manifest but I can not verify that with my mobile now.

Best,
Łukasz

Hi,

you can find a folk of openhab-addon here:

My new binding is called /org.openhab.binding.ojelectronics

I hope you can have a look and solve the problem. For adding the dependency i only added some line in the binding’s pom.xml

Thank you for your help

Christian

Hi,

thank you for your questions. I only changed my pom.xml to add the dependency. I have no idea about the microsoft package it self.

Thank you for your help

Christian

The dependency is missing in the committed pom.xml. Can you fix that and report back? I can’t check what’s wrong if the code is incomplete.

Did you mean this file?

bundles/org.openhab.binding.ojelectronics/pom.xml

My fault. I checked the ojelectronics branch, but it seems that master is the correct branch. Will check that tomorrow

Ok. Thank you

Is is possible to simply reference a jar file?

Please check the PR against your fork. That compiles for me after some fixes.

Some further comments:

  • Please do not catch Exception, catch something more specific.
  • Add null-annotations (@NonNullByDefault, @Nullable)
1 Like

Hi,

thanks for your support. I will look at your changes. And thanks for your code review. I will follow your advice.

Christian

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.