Can't build addons

Hello,

i downloaded the https://github.com/openhab/openhab1-addons repo
when i try to build one of the binding (serial) using “mvn clean package” i get following error:

ERROR in C:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\src\main\java\org\openhab\binding\serial\internal\SerialDevice.java (at line 257)
[ERROR] serialPort = portId.open(“openHAB”, 2000);

Can anyone help me with this?

Full mvn output:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[INFO] Scanning for projects…
[INFO] Computing target platform for MavenProject: org.openhab.binding:org.openhab.binding.serial:1.14.0-SNAPSHOT @ c:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\pom.xml
[INFO] Fetching p2.index from https://openhab.jfrog.io/openhab/eclipse-smarthome-stable/ (172B)
[INFO] Adding repository https://openhab.jfrog.io/openhab/eclipse-smarthome-stable
[INFO] Adding repository https://dl.bintray.com/openhab/p2/openhab-core/2.0.0
[INFO] Adding repository https://dl.bintray.com/openhab/p2/openhab-deps-repo/1.0.12
[INFO] Resolving dependencies of MavenProject: org.openhab.binding:org.openhab.binding.serial:1.14.0-SNAPSHOT @ c:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\pom.xml
[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING] org.openhab.core1/1.14.0.201907050607
[INFO] Resolving class path of MavenProject: org.openhab.binding:org.openhab.binding.serial:1.14.0-SNAPSHOT @ c:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\pom.xml
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building openHAB Serial Binding 1.14.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ org.openhab.binding.serial —
[INFO] Deleting c:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\target
[INFO]
[INFO] — tycho-packaging-plugin:1.0.0:build-qualifier (default-build-qualifier) @ org.openhab.binding.serial —
[INFO] The project’s OSGi version is 1.14.0.201908070449
[INFO]
[INFO] — tycho-packaging-plugin:1.0.0:validate-id (default-validate-id) @ org.openhab.binding.serial —
[INFO]
[INFO] — tycho-packaging-plugin:1.0.0:validate-version (default-validate-version) @ org.openhab.binding.serial —
[INFO]
[INFO] — maven-resources-plugin:2.4.3:resources (default-resources) @ org.openhab.binding.serial —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory c:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\src\main\resources
[INFO]
[INFO] — tycho-compiler-plugin:1.0.0:compile (default-compile) @ org.openhab.binding.serial —
[WARNING] The effective compiler target level 1.8 is incompatible with the following OSGi execution environments: [JavaSE-1.7 (assumes 1.7)] @ MavenProject: org.openhab.binding:org.openhab.binding.serial:1.14.0-SNAPSHOT @ c:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\pom.xml
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.585 s
[INFO] Finished at: 2019-08-07T06:49:36+02:00
[INFO] Final Memory: 25M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project org.openhab.binding.serial: Compilation failure: Compilation failure:
[ERROR] C:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\src\main\java\org\openhab\binding\serial\internal\SerialDevice.java:[257,-1]
[ERROR] 1. ERROR in C:\Projects\OpenHab\openhab-master\git\openhab1-addons\bundles\binding\org.openhab.binding.serial\src\main\java\org\openhab\binding\serial\internal\SerialDevice.java (at line 257)
[ERROR] serialPort = portId.open(“openHAB”, 2000);
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Type mismatch: cannot convert from CommPort to SerialPort
[ERROR] ----------
[ERROR] 1 problem (1 error)
[ERROR]
[ERROR] Found 1 error and 0 warnings.
[ERROR] -> [Help 1]
[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/MojoFailureException

I have the same problem, with many addons in openhab2-addons
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:46 min
[INFO] Finished at: 2019-09-12T12:46:32+07:00
[INFO] Final Memory: 186M/854M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project org.openhab.binding.elerotransmitterstick: Compilation failure
[ERROR] /home/thinhnt/openhab/openhab2-addons/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/SerialConnection.java:[56,1731] Type mismatch: cannot convert from CommPort to SerialPort
[ERROR] -> [Help 1]
[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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :org.openhab.binding.elerotransmitterstick

Any one can help me?

I just checked and it compiles for me. So I don’t know exactly what is happening.How old is your branch?

If it’s already some time ago since you have updated you could first git pull --rebase to update to the latest sources.

Also you can run maven with forced update. To force updating dependent libraries. For example for this binding only:
mvn clean install -pl :org.openhab.binding.elerotransmitterstick -U

If that all doesn’t work you can clean you maven .m2 in you local home directory in the repository, the org/openhab folder)

Hi all. I solved the issue. My problem was that my repo was not up to date and the maven repositories changed since then. I completely deleted my branch. Forked again and then it worked. Thanx for assistance.