Maven probleam (OH1)

Hi all, I see in github a binding called cm11a. I’m interested in this binding because I’ve got a CM15 module and I want to use it. I put the binding in the path /bundles/binding. I change the POM’s file and include this binding. My problem appear when I want to compile the binding using “mvn -o clean install” (of course I’m in /bundles/binding/org.openhab.binding.cm11a$) and I get this result:

mvn -o clean install
[INFO] Scanning for projects…
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openhab.binding:org.openhab.binding.cm11a:1.8.0-SNAPSHOT: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.openhab.bundles:binding:pom:1.8.3 has not been downloaded from it before. and ‘parent.relativePath’ points at wrong local POM @ line 5, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.openhab.binding:org.openhab.binding.cm11a:1.8.0-SNAPSHOT (/home/dani/Escritorio/openhab_completo/bundles/binding/org.openhab.binding.cm11a/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.openhab.binding:org.openhab.binding.cm11a:1.8.0-SNAPSHOT: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.openhab.bundles:binding:pom:1.8.3 has not been downloaded from it before. and ‘parent.relativePath’ points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

This is my java version:

HP-Pavilion-g6-Notebook-PC:~$ java -version
java version "1.8.0_101"
Java™ SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot™ 64-Bit Server VM (build 25.101-b13, mixed mode)

This is my mvn version:

HP-Pavilion-g6-Notebook-PC:~$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /apps/apache-maven-3.3.9
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: es_ES, platform encoding: UTF-8
OS name: “linux”, version: “4.4.0-36-generic”, arch: “amd64”, family: “unix”

Could anyone help me?

Thanks.

The -o flag means offline mode, but the build needs to retrieve from a Maven repository online. What happens when you omit the -o flag?

1 Like

mvn clean install
[INFO] Scanning for projects…
Downloading: https://repo.maven.apache.org/maven2/org/openhab/bundles/binding/1.8.3/binding-1.8.3.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openhab.binding:org.openhab.binding.cm11a:1.8.0-SNAPSHOT: Could not find artifact org.openhab.bundles:binding:pom:1.8.3 in central (https://repo.maven.apache.org/maven2) and ‘parent.relativePath’ points at wrong local POM @ line 5, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.openhab.binding:org.openhab.binding.cm11a:1.8.0-SNAPSHOT (/home/dani/Escritorio/openhab_completo/bundles/binding/org.openhab.binding.cm11a/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.openhab.binding:org.openhab.binding.cm11a:1.8.0-SNAPSHOT: Could not find artifact org.openhab.bundles:binding:pom:1.8.3 in central (https://repo.maven.apache.org/maven2) and ‘parent.relativePath’ points at wrong local POM @ line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

this is the message.

OK, where is the source code for the binding coming from? I don’t see it in the openhab repo or as a pull request, so I don’t know if it’s expected to be buildable.

From here https://github.com/openhab/openhab/issues/460 engineergreen posted it. I’m interested in this binding but I have to modify this to use the CM15 module. So I want to see if the binding work.

Could you help me?

I was able to build this binding successfully: download a JAR here. Obviously, I have no idea if it will work. I suspect it would have a problem running under openHAB 2 due to changes likely required to run under the different OSGi container (see this PR for examples).

Maybe you needed to perform a full mvn clean install on the top level of the openhab repo, and then try to build this binding in place thereafter? I changed a couple 1.8.0 to 1.9.0 in the source I copied. Perhaps the binding author (who seems to be Anthony Green) might want to contribute the binding source code via a pull request and wiki page?

Thank you but I’m using openHAB not opneHAB 2. How do you get the jar file? I tried to do it with eclipse but I didn’t get it. I don’t know Anthony Green, I just saw his post. I read that the binding work basic X10 functionality. My problem is that I can’t get the jar file and I can’t test the binding. Is that jar file work in openHAB (1)?

Like I said, I don’t know if the code is in a state that is expected to work, but you could try the JAR i linked above in your add-ons folder under openHAB 1.8 and try to use it. There are other bindings that support X10 in some way, but I’m not familiar with them either. Best of luck!