Hi! I'm trying to setup detekt in maven multimodul...
# detekt
i
Hi! I'm trying to setup detekt in maven multimodule project without success. I hope there is a person here who already done it and can help. Details are in thread
In the root pom.xml I add the following plugin configuration
Copy code
<plugin>
    <groupId>com.github.ozsie</groupId>
    <artifactId>detekt-maven-plugin</artifactId>
    <version>1.17.1</version>
    <executions>
        <execution>
            <phase>verify</phase>
            <goals><goal>check</goal></goals>
        </execution>
    </executions>
    <configuration>
        <config>detekt.yml</config>
        <report>html:reports/detekt-report.html</report>
    </configuration>
</plugin>
If I run
mvn detekt:create-baseline -Ddetekt.config=detekt.yml -Ddetekt.baseline=detekt-baseline.xml
I get Execution default-cli of goal com.github.ozsiedetekt maven plugin1.17.1:create-baseline failed: Provided path 'projectDirectory/src' does not exist! I understand that I don't have src for the root project because it obviously has pom packaging, but is there a workaround? Ideally My goal is having single baseline file for all submodules and single report after detekt:check goal
g
We don't officially support Maven out of the box, so is a bit complicated to support you :/
i
I hoped that there is a person who already done it 🙂 BTW what is the proper setup for gradle for such case?
j
we have it set up in our parent-pom like: https://github.com/trib3/leakycauldron/blob/main/parent-pom/pom.xml#L1483-L1537 we put our detekt config in a small "build-resources" module that everything else can depend on
176 Views