Ask Your Question
0

Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin

asked 2015-03-26 00:26:09 -0700

Eric gravatar image

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.14:check (default) on project config-subsystem: You have 39526 Checkstyle violations. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.14:check (default) on project config-subsystem: You have 39526 Checkstyle violations. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoFailureException: You have 39526 Checkstyle violations. at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:582) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: lenovo@HUQIWEI ~/controller (master).org/confluence/display/MAVEN/MojoFailureException $ RROR] [ERROR] After correcting the problems, you can resume the build with the command

When I build the opendaylight controller,I get this error,somebody can help me ?

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2015-03-26 01:22:07 -0700

Maros gravatar image

Checkstyle reports violations against a predefined set of rules for source code e.g. formatting (you can see all the violations in the output of maven above the snippet you pasted here). On current master (and also stable/helium) there are no checkstyle violations in config subsystem. So make sure your IDE or git did not change the code automatically.

edit flag offensive delete publish link more

Comments

I did nothing to these files.Just follow the instructions document.

Eric ( 2015-03-26 19:14:20 -0700 )edit

In that case could you copy or attach some of the violations reported by checkstyle ? Also what branch and commit are you currently on ?

Maros ( 2015-03-27 02:15:28 -0700 )edit

Because the limitation of characters,please see violations below.In addition, I am in China,so there is a time difference.

Eric ( 2015-03-27 18:57:11 -0700 )edit
0

answered 2015-03-27 02:58:49 -0700

Vishal Thapar gravatar image

updated 2015-03-29 22:44:43 -0700

Are you trying to compile on a windows system? If yes it could be due to CRLF conversion. You might have setup your Git to add CRLF automatically.

EDIT:

git config --global core.autocrlf <true | false | input>

true: will do CRLF conversion. This is what I believe you're using. input: will set it to repo default [this is what I use on my Windows build environment, ODL is Unix style by default] false: git will not do anything.

Read this for more, esp how to enforce it after you change the settings in an existing repo.

You want git to NOT add CRLF and also make sure to configure your IDE not to add CRLF but Unix default of LF only [applicable when editing files]. So, set it to input

edit flag offensive delete publish link more

Comments

Yes,on Windows 7 now.So how can I setup my git to add CRLF automatically?

Eric ( 2015-03-27 19:00:46 -0700 )edit

Thanks so much!It is working now.

Eric ( 2015-03-30 21:57:59 -0700 )edit
0

answered 2015-03-27 19:00:49 -0700

Eric gravatar image
#

violations

#

[ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[1] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[2] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[3] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[4] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[5] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[6] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[7] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[8] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[9] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[10] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[11] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[12] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[13] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[14] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[15] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[16] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[17] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[18] (regexp) RegexpMultiline: Line has Windows line delimiter. [ERROR] yang-test-plugin\src\main\java\org\opendaylight\controller\config\yang\test\plugin\Util.java[19] (regexp) RegexpMultiline: Line has Windows line delimiter. [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] mdsal-artifacts .................................... SUCCESS [ 0.459 s] [INFO] checkstyle ......................................... SUCCESS [ 2.866 s] [INFO] commons.opendaylight ............................... SUCCESS [ 8.296 s] [INFO] config-subsystem ................................... FAILURE [ 58.907 s] [INFO] config-api ......................................... SKIPPED [INFO] yang-jmx-generator ................................. SKIPPED [INFO] yang-jmx-generator-plugin .......................... SKIPPED [INFO] sal-parent ......................................... SKIPPED [INFO] sal-common ......................................... SKIPPED [INFO] sal-common-api ..................................... SKIPPED [INFO] sal-common-util .................................... SKIPPED

edit flag offensive delete publish link more

Comments

Why don't you skip checkstyle for quick work around.. i.e use "mvn clean install -DskipTests=true"

faizan ( 2015-03-27 20:21:01 -0700 )edit

I have tried the command of " -DskipTests=true " , but It doesn’t work .

Eric ( 2015-03-29 07:21:18 -0700 )edit

Use option `-Dcheckstyle.skip=true` to skip checkstyle tests. skipTests=true will skip JUnits, not checkstyles.

Vishal Thapar ( 2015-03-29 22:46:38 -0700 )edit

Thanks Vishal :) my mind was somewhere else i guess :D -DskipTests=true to skip test cases -Dcheckstyle.skip=true to skip checkstyle -nsu to skip updating snapshots if there is any.

faizan ( 2015-03-29 23:23:31 -0700 )edit

You're welcome (: I used to make this mistake so frequently that I ended up adding alias for it.

Vishal Thapar ( 2015-03-29 23:31:27 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-03-26 00:26:09 -0700

Seen: 4,322 times

Last updated: Mar 29 '15