Docker-java: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (checkstyle) on project docker-java: You have 3 Checkstyle violations.

Created on 8 Aug 2017  路  1Comment  路  Source: docker-java/docker-java

I am using Ubuntu 16.04, Netbeans 8.1, and Docker (Version:17.06.0-ce, API version: 1.30). This is what I did to get the attached exception:

  1. Cloned th docker-java in the Netbeans (https://github.com/docker-java/docker-java.git)
  2. Created a package under Source Packages and created a main Java class print a "Hello" as a test
  3. In the terminal I had executed "mvn clean install -X"

The attached exception is displayed and I can't fix it. Please help me I am new to docker and github and I don't know how to use docker-java. I need to create and run docker images using Java code.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (checkstyle) on project docker-java: You have 3 Checkstyle violations. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (checkstyle) on project docker-java: You have 3 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:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 3 Checkstyle violations.
at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:588)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more

log.txt

typquestion

Most helpful comment

@AbdelNaby just read the logs:

[ERROR] src/main/java/mainpackage/NewMain.java:[22,1] (design) HideUtilityClassConstructor: Utility classes should not have a public or default constructor.
[ERROR] src/main/java/mainpackage/NewMain.java:[29] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/main/java/mainpackage/NewMain.java:[32] (regexp) RegexpSingleline: Line has trailing spaces.

BTW if you need to build and run Docker images from Java you don't have to clone docker-java sources. Just add it as dependency in your build tool and use it in your sources.

>All comments

@AbdelNaby just read the logs:

[ERROR] src/main/java/mainpackage/NewMain.java:[22,1] (design) HideUtilityClassConstructor: Utility classes should not have a public or default constructor.
[ERROR] src/main/java/mainpackage/NewMain.java:[29] (regexp) RegexpSingleline: Line has trailing spaces.
[ERROR] src/main/java/mainpackage/NewMain.java:[32] (regexp) RegexpSingleline: Line has trailing spaces.

BTW if you need to build and run Docker images from Java you don't have to clone docker-java sources. Just add it as dependency in your build tool and use it in your sources.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sakib37 picture Sakib37  路  3Comments

kpnarayanan picture kpnarayanan  路  4Comments

Yannic92 picture Yannic92  路  5Comments

destebanm picture destebanm  路  5Comments

lreimer picture lreimer  路  6Comments