Skip to content

How to override source paths properly? #616

@puskarpeter

Description

@puskarpeter

Currently I am using configuration like this

<plugin>
    <groupId>com.github.gantsign.maven</groupId>
    <artifactId>ktlint-maven-plugin</artifactId>
    <version>3.2.0</version>
    <configuration>
        <experimental>true</experimental>
        <sourceRoots>
            <sourceRoot>${project.basedir}/src/main/kotlin</sourceRoot>
        </sourceRoots>
        <testSourceRoots>
            <sourceRoot>${project.basedir}/src/test/kotlin</sourceRoot>
        </testSourceRoots>
    </configuration>
    <executions>
        <execution>
            <id>check</id>
            <goals>
                <goal>check</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Since the project contains combined Java and Kotlin sources, but all Kotlin sources are in the folder structure above.
This works, but I am getting these warnings:

[WARNING]  Parameter 'sourceRoots' is read-only, must not be used in configuration
[WARNING]  Parameter 'testSourceRoots' is read-only, must not be used in configuration

If it is read-only, I do not know why it works (maybe it is not enforced), but I did not find any simpler solution.
Should I configure the plugin in some other way or maybe from the plugin side these parameters should have read-only=false?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions