-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OH3: Maven build failing (bad format violations in a POM) #8712
Comments
I even don't find this project org.openhab.addons.reactor.bundles in the repo. And the Static code analysis summary report contains no additional information. Just to mention this is maven run just after cloning the git repo and after installing a new JDK 11.
|
I run into that problem sometimes, too. I guess it‘s something with the git line-ending setting. You can use |
I got the same error when running |
Check bypassed if I use the following command: This is probably something to add in the documentation in addtion to |
I am on Windows. You say if could be git line-ending setting. Could it be a wrong line encoding of this POM file ? |
My feeling is that it‘s more a spotless bug (could be it doesn‘t detect the correct line-ending). |
Very interestingnit works for you without the "". It‘s not working for me without. Are you using |
It was run from a Git Bash window. |
With spotless checking disabled, the build succeeded. |
It takes 1h14'. I have the feeling it takes largely more time than before (OH2) (twice the time ?).
It only takes 18'54'' if I skip checks and tests. |
It might cause Spotless to think you prefer Unix-like line endings while Git thinks you prefer DOS/Windows line endings. See also the Spotless line endings documentation:
The only increase in build times I have noticed is due to more add-ons having been merged recently. Try disabling feature verification and a parallel build, e.g.:
With that it only takes ~1 minute to build all add-ons on my machine. |
The result (error) is the same if I use Windows PowerShell. |
@wborn I think you are right about the line endings. It seems if you checkout .xml files with Linux \n file endings on Windows maven finds the file invalid (which I can imagine), but if you checkout with Windows line endings \r\n spotless does think the file has bad formatting. If you let spotless allow Windows line endings on Windows (if this is possible, didn't check yet) and you commit them with Windows line endings, you have mixed Linux and Windows line endings in the repository, also the spotless checks of the buildserver will fail. One way to have better control as project over line endings is to add a .gitattributes file to the project with:
and if needed specify which file need to be handled as text if autodetection fails:
See also: I think .gitattributes should be added to the project and spotless should be to configured to lineEndings 'GIT_ATTRIBUTES' |
Looks like the |
Without this configuration there are issues with line endings on Windows. See: openhab#8712 Signed-off-by: Wouter Born <[email protected]>
Without this configuration there are Spotless issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
Without this configuration there are issues with line endings on Windows. See: #8712 Signed-off-by: Wouter Born <[email protected]>
Without this configuration there are Spotless issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
Without this configuration there are Spotless issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
@wborn Thanks! |
I hope it also solves @lolodomo's issues. If you did not have them on the 2.5.x branch they should now be solved as well. :-) |
It solves the problem for me :) |
I updated my local repo but unfortunately I still have the same problem when I try to compile the main branch. |
I think I know what might go wrong.
With explicit linux line endings... |
Perhaps there is one of the @openhab/add-ons-maintainers who uses Windows and can check if there are still Spotless issues on the main branch and what could fix them? I have no issues or easy ways to reproduce this on Ubuntu. 😉 |
I don't think it is the openhab-core/tools/static-code-analysis/checkstyle/ruleset.properties |
Without this configuration there are Spotless issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
For some reason spotless seems to ignore .gitattributes on master. |
Try the |
openhab-core still uses master |
Without this configuration there are Spotless issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
Without this configuration there are Spotless issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
diffplug/spotless#540 related? |
I get the same error (on Win 10) if I start from the root-POM. Building single projects with |
I can confirm that build from inside a binding is working. |
|
You might want |
Without this configuration there are issues with line endings on Windows. See: openhab#8712 Signed-off-by: Wouter Born <[email protected]>
Without this configuration there are issues with line endings on Windows. See: openhab/openhab-addons#8712 Signed-off-by: Wouter Born <[email protected]>
Is this still an open issue ? |
For me it works fine on Windows using: git config --global core.autocrlf false
git config --global core.eol crlf |
I have to test these settings. |
If it works better we probably want to update the developer docs as well. Sometimes those |
Tried and working. Thank you |
Even using
-DskipChecks
does not help avoiding this blocking step.Is there a way to disable this check ?
The text was updated successfully, but these errors were encountered: