Replace modules with subprojects

Apache 2.0

Maven 4 model version 4.1.0 deprecates the <modules> element in favor of <subprojects> to eliminate confusion with Java's Platform Module System (JPMS). This recipe renames <modules> to <subprojects> and <module> children to <subproject>.

org.openrewrite.maven.ReplaceModulesWithSubprojects
mod run . --recipe=org.openrewrite.maven.ReplaceModulesWithSubprojects

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change XML tag name /project/modules/module to subproject
  2. Change XML tag name /project/modules to subprojects