UTF-8 BOM breaks Java Spring Boot on Linux CI pipeline

This bug cost me hours and it wasn’t even visible. Pushed code that worked perfectly on my machine. CI pipeline failed instantly on Linux. The culprit? Something most developers never notice. We were migrating a Java Spring Boot application to Azure, with a Bitbucket CI/CD pipeline running on Linux. All tests passed locally on Windows. But the pipeline kept failing with this cryptic error: [ERROR] SomeTest.java:[1,1] illegal character: '\ufeff' [ERROR] class, interface, enum, or record expected No logic issue. No syntax error. The problem was UTF-8 with BOM, Windows had added 3 invisible bytes at the start of Java files. The Linux Java compiler doesn’t accept it. Fix: Re-saved files as UTF-8 without BOM -> pipeline turned green. 7 files affected. Hours saved (after hours lost 😄). Cross-platform differences (encoding, line endings, case sensitivity) can silently break CI pipelines. If you code on Windows but build on Linux, check your file encoding. Invisible characters can break very visible things. #Java #CICD #DevOps #SpringBoot #CloudMigration #TIL

To view or add a comment, sign in

Explore content categories