The Kotlin coding conventions advise omitting the common root package:
In pure Kotlin projects, the recommended directory structure follows the package structure with the common root package omitted. For example, if all the code in the project is in the
org.example.kotlinpackage and its subpackages, files with theorg.example.kotlinpackage should be placed directly under the source root, and files inorg.example.kotlin.network.socketshould be in thenetwork/socketsubdirectory of the source root.
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>6.8.0</version>
<configuration>
<activeRecipes>
<recipe>com.yourorg.yourproject.Migrate</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>rewrite.yml
---
type: specs.openrewrite.org/v1beta/recipe
name: ch.frankel.MyMigration
recipeList:
- ch.frankel.openrewrite.kotlin.FlattenStructure:
rootPackage: com.acme|
Warning
|
The plugin assumes you store your source files under |