Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to override source paths properly? #616

Open
puskarpeter opened this issue Apr 30, 2024 · 0 comments
Open

How to override source paths properly? #616

puskarpeter opened this issue Apr 30, 2024 · 0 comments

Comments

@puskarpeter
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant