2019年8月27日

https://stackoverflow.com/questions/34850125/got-could-not-find-resource-src-checkstyle-checkstyle-suppressions-xml-when-u

Question

Should not maven-checkstyle-plugin provides default config xml file? Why got this error when running maven?

I can't google some solution for this issue , please help me get it, Thanks!

The error message as below:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.16:check (checkstyle-validation) on project explorer-parent: Failed during checkstyle execution: Unable to find suppressions file at location: src/checkstyle/checkstyle-suppressions.xml: Could not find resource 'src/checkstyle/checkstyle-suppressions.xml'. -> [Help 1]


attached pom file: parent pom module pom

Answer

You are using the wrong parent in your pom.xml file. You are using spring-boot-parent but it should be spring-boot-starter-parent.

Update the pom.xml of explorer-parent so that its <parent> looks like this:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.1.RELEASE</version>
</parent>
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐