Code style
CI fails the build on style violations - run formatting before every push.
Java formatter
The format definition is dirigible-formatter.xml at the repo root. Apply with:
mvn formatter:format # whole project
mvn -pl <module> formatter:format # one moduleCI runs mvn -T 1C formatter:validate and fails on any violation. The IDE save action (Eclipse / IntelliJ / VS Code) can apply the formatter on save - see CONTRIBUTING.md in the platform repo.
License headers
Every .java / .js / .properties file carries the EPL-2.0 header. Add or refresh with:
mvn license:format -P license -DskipExistingHeaders=falseThe default mvn install profile sets license.skip=false, so headers are validated as part of a normal build. Local-iteration profiles (quick-build) often skip the check.
Conventions
Always write production-ready Java. Single-responsibility methods, intention-revealing names, correct visibility, immutability (prefer
final), proper resource handling (try-with-resources), precise exception handling, no commented-out blocks, no dead code, no swallowed exceptions.Constructor injection only. Every Spring bean (
@Component/@Service/@Repository/@Configuration/@RestController) receives collaborators through the constructor and holds them inprivate finalfields. No@Autowiredon fields, no setter injection. The single documented exception is QuartzJobclasses (instantiated reflectively before Spring autowiring runs) - they keep@Autowiredfield injection.Package-private by default. Drop
publicfrom any class/interface/enum used only within its own Java package. Cross-package types within the same Maven module needpublic. SPI types staypublic. Documented exceptions: QuartzJobclasses and Spring Data repositories.Always log the throwable. Every
catchblock's log call must pass the exception as the trailing SLF4J argument -logger.error("...", ex), notlogger.error("..." + ex.getMessage()). The throwable goes through SLF4J's out-of-band slot; the{}placeholder count stays balanced.Configuration through
DirigibleConfig/Configuration. Add new tunables to the enum, not ad-hocSystem.getPropertycalls.Bean-definition overriding is enabled. Duplicate
@Beannames silently shadow each other - be deliberate.JPA scan packages are
org.eclipse.dirigible.componentsandorg.eclipse.dirigible.engine. New entities under either tree are picked up automatically.Cross-module FK cascades use
@org.hibernate.annotations.OnDelete(action = OnDeleteAction.CASCADE)to avoid forming a Maven dependency cycle through JPA's bidirectional cascade. SeeRoleSynchronizerCleanupITfor the canonical case.