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:
@@ -1,6 +1,5 @@
Run ‘mvn spotless:apply’ to fix these violations.
at com.diffplug.spotless.maven.SpotlessCheckMojo.process (SpotlessCheckMojo.java:66)
Thanks in advance for your help.
I had just a similar problem, “The following files had format violations:”
I then run mvn spotless:apply in */openhab-addons/bundles
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
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.
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] 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] 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] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :org.openhab.binding.sonos