Initial mvn for binding fails

I did a fresh IDE install with the Eclipse installer
I create a new binding with create_openhab_binding_skeleton.sh

./create_openhab_binding_skeleton.sh MagentaTV "Markus Michels"

and run “mvn install” from the binding directory.
This results in:

[ERROR] Code Analysis Tool has found: 
 6 error(s)! 
 1 warning(s) 
 5 info(s)
[ERROR] .binding.magentatv/ESH-INF/binding/binding.xml:[5]
Cannot find the declaration of element binding:binding.
[ERROR] .binding.magentatv/ESH-INF/thing/thing-types.xml:[5]
Cannot find the declaration of element thing:thing-descriptions.
[ERROR] org.openhab.binding.magentatv.internal.MagentaTVConfiguration.java:[2]
Header line doesn't match pattern ^ \* Copyright \(c\) 2010-2019 Contributors to the openHAB project$
[WARNING] org.openhab.binding.magentatv.internal.MagentaTVConfiguration.java:[20]
Classes/Interfaces should be annotated with @NonNullByDefault
[ERROR] org.openhab.binding.magentatv.internal.MagentaTVHandler.java:[2]
Header line doesn't match pattern ^ \* Copyright \(c\) 2010-2019 Contributors to the openHAB project$
[ERROR] org.openhab.binding.magentatv.internal.MagentaTVHandlerFactory.java:[2]
Header line doesn't match pattern ^ \* Copyright \(c\) 2010-2019 Contributors to the openHAB project$
[ERROR] org.openhab.binding.magentatv.internal.MagentaTVBindingConstants.java:[2]
Header line doesn't match pattern ^ \* Copyright \(c\) 2010-2019 Contributors to the openHAB project$

Those 2 are strange:

[ERROR] .binding.magentatv/ESH-INF/binding/binding.xml:[5]
Cannot find the declaration of element binding:binding.
[ERROR] .binding.magentatv/ESH-INF/thing/thing-types.xml:[5]
Cannot find the declaration of element thing:thing-descriptions.

because binding.xml

<?xml version="1.0" encoding="UTF-8"?>
<binding:binding
	id="magentatv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
	xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">
	<name>MagentaTV Binding</name>
	<description>This is the binding for MagentaTV receivers.</description>
	<author>Markus Michels</author>
</binding:binding>

as well as thing-types.xml have those declarations

<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="magentatv"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
	xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
...
</thing:thing-descriptions>

The wrong © format could be easily fixed, but obviously the checkstyle templates are not correct.


How could I create a clean skeleton?

I noticed that the binding.xml is still created referring to http://eclipse.org/smarthome/schemas/binding instead of https://openhab.org/schemas/binding

	xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
	xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">

@Kai Could someone please fix the skeleton generation? It’s very strange if the generated files do no reflect the status of the current environment.

There is a big sticky issue in the openhab2-addons github repo telling about the current buildsystem migration :wink: Oh and the https://www.openhab.org/docs/developer/development/ide.html#option-1-installation-of-ide-for-add-on-development page is also telling you about it.

Writing up new howtos, tutorials and fixing the skeleton is the last part of that migration, after everything has been figured out.

I mean, how can we make that more obvious for people?

2 Likes

ok, I put the binding on hold and closed the PR