File tree Expand file tree Collapse file tree
diktat-maven-plugin/src/main/kotlin/com/saveourtool/diktat/plugin/maven Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ abstract class DiktatBaseMojo : AbstractMojo() {
9292 if (excludes.isNotEmpty()) " and excluding $excludes " else " "
9393 )
9494
95- val sourceRootDir = generateSequence(mavenProject) { it.parent }.last().basedir.toPath ()
95+ val sourceRootDir = getSourceRootDirTransitive ()
9696 val reporters: List <Reporter > = (reporters?.getAll() ? : listOf (PlainReporter ()))
9797 .let { all ->
9898 if (githubActions && all.filterIsInstance<GitHubActionsReporter >().isEmpty()) {
@@ -138,6 +138,13 @@ abstract class DiktatBaseMojo : AbstractMojo() {
138138 .firstOrNull { it.isRegularFile() }
139139 }
140140
141+ private fun getSourceRootDirTransitive (): Path = generateSequence(mavenProject) { project ->
142+ val parent = project.parent
143+ parent?.basedir?.let {
144+ parent
145+ }
146+ }.last().basedir.toPath()
147+
141148 private fun files (): List <Path > {
142149 val (excludedDirs, excludedFiles) = excludes.map(::File ).partition { it.isDirectory }
143150 return inputs
You can’t perform that action at this time.
0 commit comments