How to run checkstyle. #2
Answered
by
i-am-alex-h
ChrisTaylorDeveloper
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Hi, Chris,
Try mvn checkstyle:check
Regards
Alex
Sent: Sunday, March 10, 2024 at 7:22 PM
From: "Chris Taylor" ***@***.***>
To: "ChrisTaylorDeveloper/bdd-selenium-starter" ***@***.***>
Cc: "Alex" ***@***.***>, "Mention" ***@***.***>
Subject: [ChrisTaylorDeveloper/bdd-selenium-starter] How to run checkstyle. (Discussion #2)
@i-am-alex-h Hi Alex. How can i run checkstyle?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ChrisTaylorDeveloper
-
Hi, Chris,
I've got the bdd-selenium-starter project working on my laptop now.
Try mvn validate
I think the problem with running mvn checkstyle:check directly is that by default the Checkstyle plugin does not check the formatting of test cases. (I need to read the documentation more carefully to confirm this.) Since the only Java code in the project is test cases the Checkstyle plugin doesn't report any violations.
In commit a168196 (Add checkstyle plugin.) the checkstyle:check goal is bound to the validate phase of the default lifecycle (https://maven.apache.org/ref/3.8.6/maven-core/lifecycles.html). The bound plugin has includeTestSourceDirectory set to true. When the goal runs as part of the validate phase it does report violations in the test source code.
Also try
mvn compile
and
mvn test
Since the compile and test phases both occur later in the default lifecycle than the validate phase the checkstyle:check goal will be run with the correct configuration.
regards
Alex
Sent: Monday, March 11, 2024 at 1:02 PM
From: "Chris Taylor" ***@***.***>
To: "ChrisTaylorDeveloper/bdd-selenium-starter" ***@***.***>
Cc: "Alex" ***@***.***>, "Mention" ***@***.***>
Subject: Re: [ChrisTaylorDeveloper/bdd-selenium-starter] How to run checkstyle. (Discussion #2)
I've tried mvn checkstyle:check and mvn checkstyle:checkstyle including (what I assume) are violations in the source but the report keeps telling me everything is fine! How can I get mvn to report a violation?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@i-am-alex-h Hi Alex. How can i run checkstyle?
Beta Was this translation helpful? Give feedback.
All reactions