OH 3 - skeleton script generates an error under linux

Dear Community,

First of all: Merry Christmas!

I was trying to use the binding skeleton script under linux and got the following error message after a first maven-build after the files for the new binding were created:
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: The following files had format violations:
src/main/resources/OH-INF/thing/thing-types.xml
@@ -1,6 +1,5 @@
<?xml·version="1.0"·encoding="UTF-8"?>
-<thing:thing-descriptions·bindingId=“cus”
-\txmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
+<thing:thing-descriptions·bindingId=“cus”·xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
\txmlns:thing=“https://openhab.org/schemas/thing-description/v1.0.0
\txsi:schemaLocation=“https://openhab.org/schemas/thing-description/v1.0.0·https://openhab.org/schemas/thing-description-1.0.0.xsd”>
Run ‘mvn spotless:apply’ to fix these violations.
at com.diffplug.spotless.maven.SpotlessCheckMojo.process (SpotlessCheckMojo.java:66)

Thanks in advance for your help.

Best regards,
Jochen

Hi!
I had just a similar problem, “The following files had format violations:”
I then run mvn spotless:apply in */openhab-addons/bundles

//Basse

Thanks Basse - I guess it does make sense to write an issue about that on github. Maybe we will be able to find a solution and help fixing that. What do you think?

UPDATE: here is the issue on github - [skeleton script] Newly created addon will throw a maven-related exception · Issue #9528 · openhab/openhab-addons · GitHub

Cheers
Jochen

Great,
I was running mvn -pl ‘binding’ clean install when I got this message, so maybe it’s related to maven.
Let’s see if github will help us a little bit further, I have seen this from time to time irregularly, and it seems to work with mvn spotless…, but it would be better not see it at all.

//Basse

Under windows I received the same error so I ran mvn spotless:apply. However, it got me passed my error because my binding is before sonos, but sonos received:

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.0.3:apply (default-cli) on project org.openhab.binding.sonos: Unable to format file C:\Users\ed\Documents\Visual Studio Projects\openhab-addons\bundles\org.openhab.binding.sonos\src\main\resources\OH-INF\thing\channels.xml: C:\Users\ed\Documents\Visual Studio Projects\openhab-addons\bundles\org.openhab.binding.sonos\src\main\resources\OH-INF\thing\channels.xml: The requested operation cannot be performed on a file with a user-mapped section open. → [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :org.openhab.binding.sonos