Maven checkstyle fails locally

Application Name: openmrs-core

Version Number: main branch

Question: I am trying to run checkstyle as suggested here (https://openmrs.atlassian.net/wiki/spaces/docs/pages/25477044/Java+Conventions#Manual-Run), using:

mvn clean package jxr:aggregate checkstyle:checkstyle-aggregate -DskipTests

I get the following error:

[INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 34.253 s [INFO] Finished at: 2026-05-13T11:36:15+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:checkstyle-aggregate (default-cli) on project openmrs: An error has occurred in Checkstyle report generation.: Failed during checkstyle configuration: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of LineLength Please review ‘Parent Module’ section for this Check in web documentation if Check is standard. → [Help 1]

Looks like someone else had the same problem but no solution ( make checkstyle work ).

Is it possible openmrs-core/checkstyle.xml doesn’t work with recent versions of checkstyle? Any help appreciated.

Despite what that page says, I don’t think we’ve used Checkstyle in a while. I would probably not try to follow those steps.

Ah cool -thanks :slight_smile: