Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin
idea编译项目时,出现如下报错:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (validate) on project devops-brain: Failed during checkstyle configuration: Cannot set property 'cacheFile' to 'F:\Copote\Code\devops-brain\devops-brain\target/checkstyle-cachefile': InvocationTargetException: com/谷歌/common/io/Flushables: com.谷歌.common.io.Flushables -> [Help 1]
进入pom.xml所在目录,如图:
执行如下命令,查看详细日志:
mvn clean package -e -X
-
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (validate) on project devops-brain: Failed during checkstyle configuration: Cannot set property 'cacheFile' to 'target/c
-
achefile': InvocationTargetException: com/谷歌/common/io/Flushables: com.谷歌.common.io.Flushables -> [Help 1]
-
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (validate) on project devops-brain: Failed during checkstyle configurati
-
on
-
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
-
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
-
...
-
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
-
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed during checkstyle configuration
-
at org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo.execute (CheckstyleViolationCheckMojo.java:534)
-
...
-
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
-
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Cannot set property 'cacheFile' to 'target/cachefile'
-
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty (AutomaticBean.java:237)
-
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure (AutomaticBean.java:191)
-
...
-
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
-
Caused by: java.lang.reflect.InvocationTargetException
-
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
-
...
-
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
-
Caused by: java.lang.NoClassDefFoundError: com/谷歌/common/io/Flushables
-
at com.puppycrawl.tools.checkstyle.PropertyCacheFile.flushAndCloseOutStream (PropertyCacheFile.java:167)
-
...
-
Caused by: java.lang.ClassNotFoundException: com.谷歌.common.io.Flushables
-
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
-
...
-
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
-
[ERROR]
-
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
-
[ERROR]
-
[ERROR] For more information about the errors and possible solutions, please read the following articles:
-
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
定位到日志:
Caused by: java.lang.ClassNotFoundException: com.谷歌.common.io.Flushables
这个类在如下依赖jar包中,在pom中添加如下依赖:
-
<dependency>
-
<groupId>com.谷歌.guava</groupId>
-
<artifactId>guava</artifactId>
-
<version>20.0</version>
-
</dependency>
如果依赖引入后还不行,请删除本地maven库中guava目录,重新导入:
重新编译项目,如果没其他错误,即可成功。不幸的是,作者编译后继续报错如下:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (validate) on project devops-brain-manager-bean: Failed during checkstyle execution: There are 8 errors reported by Checkstyle 8.18 with ../../code-style/checkstyle.xml ruleset. -> [Help 1]
继续执行如下命令,查看详细日志:
mvn clean package -e -X
如图:
-
[INFO] 寮?濮嬫鏌モ?︹??
-
[ERROR] F:\Copote\Code\...\dto\AlertRuleDto.java:7:4: 鏈煡鏍囩 'description' 銆? [JavadocType
-
]
-
[ERROR] F:\Copote\Code\...\entity\AlertRuleEntity.java:7:4: 鏈煡鏍囩 'description' 銆? [Javad
-
ocType]
-
[ERROR] F:\Copote\Code\...\entity\AlertsEntity.java:7:4: 鏈煡鏍囩 'description' 銆? [JavadocT
-
ype]
-
[ERROR] F:\Copote\Code\...\entity\BaseEntity.java:12:47: WhitespaceAround: '{' is not preceded wi
-
th whitespace. [WhitespaceAround]
-
[ERROR] F:\Copote\Code\...\entity\HostConfigEntity.java:11:49: WhitespaceAround: '{' is not prece
-
ded with whitespace. [WhitespaceAround]
-
[ERROR] F:\Copote\Code\...\entity\HostEntity.java:7:4: 鏈煡鏍囩 'Author' 銆? [JavadocType]
-
[ERROR] F:\Copote\Code\...\entity\HostEntity.java:8:4: 鏈煡鏍囩 'Date' 銆? [JavadocType]
-
[ERROR] F:\Copote\Code\...\entity\HostEntity.java:9:4: 鏈煡鏍囩 'Version' 銆? [JavadocType]
-
[ERROR] F:\Copote\Code\...\entity\HostEntity.java:10:4: 鏈煡鏍囩 'Description' 銆? [JavadocTy
-
pe]
-
[ERROR] F:\Copote\Code\...\entity\HostTagEntity.java:6: 缂哄皯 Javadoc 銆? [JavadocType]
-
[ERROR] F:\Copote\Code\...\entity\MetricEntity.java:8:4: 鏈煡鏍囩 'description' 銆? [JavadocT
-
ype]
-
[ERROR] F:\Copote\Code\...\entity\MetricTemplateEntity.java:7:4: 鏈煡鏍囩 'description' 銆? [
-
JavadocType]
-
妫?鏌ュ畬鎴愩??
-
[INFO] ------------------------------------------------------------------------
-
...
-
Caused by: org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorException: There are 12 errors reported by Checkstyle 8.18 with ../../code-style/checkstyle.xml ruleset.
-
at org.apache.maven.plugins.checkstyle.exec.DefaultCheckstyleExecutor.executeCheckstyle (DefaultCheckstyleExecutor.java:309)
定位到日志:
There are 8 errors reported by Checkstyle 8.18 with ../../code-style/checkstyle.xml ruleset. -> [Help 1]
原因是存在多处代码不符合风格。逐个检查修改即可。
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhfeeehg
-
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQ
-
commons-lang3
-
org.apache.catalina.core.StandardContext.startInternal 由于:前的错误,Context[/SpringMVC]启动失败
-
JDK8升级到JDK11后Cannot resolve symbol ‘BASE64Encoder‘
-
Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project
-
Apache的配置和运用
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01 -
怎样阻止微信小程序自动打开
PHP中文网 06-13