Skip to content
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

Introduce maven-checkstyle-plugin to validate no star imports #521

Merged
merged 2 commits into from
Feb 16, 2019

Conversation

sghill
Copy link
Contributor

@sghill sghill commented Feb 15, 2019

It'd be great to have the build validate style rules for newer contributors to the project. I added the AvoidStarImport rule through the maven-checkstyle-plugin based on feedback from #516.

Here's how it fails when there is a star import:

[INFO] --- maven-checkstyle-plugin:3.0.0:check (validate) @ slack ---
[INFO] Starting audit...
[ERROR] <repo>/slack-plugin/src/main/java/jenkins/plugins/slack/ActiveNotifier.java:6: Using the '.*' form of import should be avoided - hudson.model.*. [AvoidStarImport]
Audit done.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.656 s
[INFO] Finished at: 2019-02-15T14:09:19-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (validate) on project slack: Failed during checkstyle execution: There is 1 error reported by Checkstyle 6.18 with checkstyle.xml ruleset. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll build on this 👍

@timja timja merged commit d5ceadd into jenkinsci:master Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants