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
Property 'libraries' is misspelled or does not exist. #169
Comments
You need to add the libraries artifact just like any other third party ruleset. See "To enable this rule set" paragraph in the docs There are two first party rulesets not included by default: |
I haven't used this Maven plugin, but looking at the readme, I think this is the section you need: https://github.com/Ozsie/detekt-maven-plugin#using-plugin, the second code block with dependencies. |
@TWiStErRob thank you, but it is still not clear how to add those rulesets when running via maven plugin. I tried this, it does not help: <dependency>
<groupId>io.gitlab.arturbosch.detekt</groupId>
<artifactId>detekt-rules-libraries</artifactId>
<version>${detekt-maven-plugin.version}</version> <!-- this is 1.22.0 -->
<scope>runtime</scope>
</dependency> |
Is it inside the plugins block? |
@TWiStErRob yes, the problem was that I was putting the dependencies in the artifact dependencies instead of plugin dependencies. It Is working now, thanks a lot for pointing me to this doc block. 👍 My plugin configuration now looks like this: <plugin>
<groupId>com.github.ozsie</groupId>
<artifactId>detekt-maven-plugin</artifactId>
<version>${detekt-maven-plugin.version}</version>
<configuration>
<baseline>.mvn/baseline-rss-app.xml</baseline>
<config>detekt.yml</config>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<!-- enable "libraries" ruleset -->
<!-- see https://github.com/Ozsie/detekt-maven-plugin/issues/169 -->
<dependencies>
<dependency>
<groupId>io.gitlab.arturbosch.detekt</groupId>
<artifactId>detekt-rules-libraries</artifactId>
<version>${detekt-maven-plugin.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin> |
According to these warnings
I moved these rules to
libraries
, which is conforming todetekt-1.22.0.json
:But the plugin execution is now falling with
The same happens if I add
formatting
rules:Related issues
detekt/detekt#5360 — this seems to be the PR where these rules have been refactored.
detekt/detekt#5548 — this says it should provide examples for avoiding this, but it will be gradle plugin, not maven plugin.
I think the updated doc link is here — https://detekt.dev/docs/next/rules/libraries/.
and it says
detekt/detekt#5304 — this issue says that we have to add more gradle dependencies eg for
formatting
, but how to do this when using the maven plugin?How should we add the non-default rulesets when using the maven plugin?
The text was updated successfully, but these errors were encountered: