I’m having problems with building clean 3.4.2 addons. What I did:
- clone the source from github
- checkout 3.4.2 tag (detached head state)
- create branch 3.4.2
- run mvn clean install
- boom - error with formatting (I can fix it with mvn spotless:apply)
The error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.140 s
[INFO] Finished at: 2023-04-08T11:41:27+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.0.3:check (codestyle_check) on project org.openhab.addons.reactor: The following files had format violations:
[ERROR] pom.xml
[ERROR] @@ -1,4 +1,6 @@
[ERROR] -<?xml·version="1.0"·encoding="UTF-8"·standalone="no"?><project·xmlns="http://maven.apache.org/POM/4.0.0"·xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"·xsi:schemaLocation="http://maven.apache.org/POM/4.0.0·https://maven.apache.org/xsd/maven-4.0.0.xsd">
[ERROR] +<?xml·version="1.0"·encoding="UTF-8"·standalone="no"?>
[ERROR] +<project·xmlns="http://maven.apache.org/POM/4.0.0"·xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
[ERROR] +··xsi:schemaLocation="http://maven.apache.org/POM/4.0.0·https://maven.apache.org/xsd/maven-4.0.0.xsd">
[ERROR] ··<modelVersion>4.0.0</modelVersion>
[ERROR]
[ERROR] ··<parent>
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[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/MojoExecutionException
My setup:
$ cat /etc/fedora-release
Fedora release 36 (Thirty Six)
fedora:/home/przemo/software/openhab-addons
$ mvn -v
Apache Maven 3.8.4 (Red Hat 3.8.4-3)
Maven home: /usr/share/maven
Java version: 17.0.6, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.6.0.10-1.fc36.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.2.8-100.fc36.x86_64", arch: "amd64", family: "unix"
fedora:/home/przemo/software/openhab-addons
$ java -version
openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment (Red_Hat-17.0.6.0.10-1.fc36) (build 17.0.6+10)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.6.0.10-1.fc36) (build 17.0.6+10, mixed mode, sharing)
I use vim + syntastic for development, but that shouldn’t make any difference.
Is that normal? My goal is here. but in order to make any mods I need to be able to compile the “vanilla” version first.