Re: Running maven-checkstyle-plugin from the root module

2024-04-21 Thread org . apache . maven . user
On 21/04/2024 19:03, Jeff Jensen wrote:
> Sorry for the vagueness.  I meant something even simpler - running the
> Checkstyle goal separately, probably in two Maven executions similar to:
>   mvn checkstyle:checkstyle
>   mvn install -Dcheckstyle.skip=true

I have ended up having to do something kind of similar to that in
practice on the larger builds. I'm trying to get to the point where
"mvn clean package" is always the acceptable thing to run, rather than
having to split things up into separate commands during development
(hence this message to the list!).

-- 
Mark Raynsford | https://www.io7m.com


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Running maven-checkstyle-plugin from the root module

2024-04-21 Thread Jeff Jensen
Sorry for the vagueness.  I meant something even simpler - running the
Checkstyle goal separately, probably in two Maven executions similar to:
  mvn checkstyle:checkstyle
  mvn install -Dcheckstyle.skip=true


On Sun, Apr 21, 2024 at 12:35 PM  wrote:

> On 21/04/2024 15:59, Jeff Jensen wrote:
> > Have you considered only running the checkstyle goal, from the parent so
> it
> > processes all modules, before the full build goal(s)?
> >
>
> There are two ways that I can interpret this:
>
> 1. Set the execution in the parent so that all of the child modules
> essentially gain an execution. This is what I already have, and has the
> limitations I described.
> 2. Set an execution in the parent that somehow processes all child
> modules and is not inherited.
>
> I think 2. is what I want, but I can't see from the documentation how
> the plugin can be configured like this. It seems like it wants to work
> on one module at a time.
>
> Have I missed something?
>
> --
> Mark Raynsford | https://www.io7m.com
>
>


Re: Running maven-checkstyle-plugin from the root module

2024-04-21 Thread org . apache . maven . user
On 21/04/2024 15:59, Jeff Jensen wrote:
> Have you considered only running the checkstyle goal, from the parent so it
> processes all modules, before the full build goal(s)?
> 

There are two ways that I can interpret this:

1. Set the execution in the parent so that all of the child modules
essentially gain an execution. This is what I already have, and has the
limitations I described.
2. Set an execution in the parent that somehow processes all child
modules and is not inherited.

I think 2. is what I want, but I can't see from the documentation how
the plugin can be configured like this. It seems like it wants to work
on one module at a time.

Have I missed something?

-- 
Mark Raynsford | https://www.io7m.com


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Running maven-checkstyle-plugin from the root module

2024-04-21 Thread Jeff Jensen
Have you considered only running the checkstyle goal, from the parent so it
processes all modules, before the full build goal(s)?


On Sun, Apr 21, 2024 at 9:27 AM  wrote:

> Hello!
>
> I've been using the maven-checkstyle-plugin for many years now. Almost
> all of my projects are heavily multi-module, and I have a fairly
> traditional setup where a checkstyle plugin execution is defined in
> my organization-wide POM, and inherited by all modules in all projects.
> I run checkstyle in the process-sources phase and refuse to build
> code if there are style errors:
>
> https://github.com/io7m/primogenitor/blob/develop/pom.xml#L503
>
> This works well enough in the sense that I don't have to repeat any
> configuration information, and I can opt-out of checking on a per-module
> basis if necessary by setting checkstyle.skip in the module's properties.
>
> Where it _doesn't_ work well enough is that I really want to, for a
> given project, get all style errors in all modules before anything else
> in the build proceeds. I have projects where style checks succeed in
> module A, and then module B takes a minute or so to build, and then a
> style check fails in module C. I'd prefer to style check modules A, B,
> and C ahead of time so that I don't have to sit through a time-consuming
> build of B just to have C fail.
>
> There doesn't seem to be a nice way to configure this. Ideally I would
> want checkstyle to check all sources matching a given pattern
> ("*/src/main/java/**.java", probably). Even if I _could_ get the plugin
> to do this, it's not clear how I would preserve the ability to opt-out
> of checking on a per-module basis. I'm aware of the source-level
> comments like // CHECKSTYLE:OFF and so on, but I prefer to put this kind
> of thing in the POM.
>
> Anyone got any ideas?
>
> --
> Mark Raynsford | https://www.io7m.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Running maven-checkstyle-plugin from the root module

2024-04-21 Thread org . apache . maven . user
Hello!

I've been using the maven-checkstyle-plugin for many years now. Almost
all of my projects are heavily multi-module, and I have a fairly
traditional setup where a checkstyle plugin execution is defined in
my organization-wide POM, and inherited by all modules in all projects.
I run checkstyle in the process-sources phase and refuse to build
code if there are style errors:

https://github.com/io7m/primogenitor/blob/develop/pom.xml#L503

This works well enough in the sense that I don't have to repeat any
configuration information, and I can opt-out of checking on a per-module
basis if necessary by setting checkstyle.skip in the module's properties.

Where it _doesn't_ work well enough is that I really want to, for a
given project, get all style errors in all modules before anything else
in the build proceeds. I have projects where style checks succeed in
module A, and then module B takes a minute or so to build, and then a
style check fails in module C. I'd prefer to style check modules A, B,
and C ahead of time so that I don't have to sit through a time-consuming
build of B just to have C fail.

There doesn't seem to be a nice way to configure this. Ideally I would
want checkstyle to check all sources matching a given pattern
("*/src/main/java/**.java", probably). Even if I _could_ get the plugin
to do this, it's not clear how I would preserve the ability to opt-out
of checking on a per-module basis. I'm aware of the source-level
comments like // CHECKSTYLE:OFF and so on, but I prefer to put this kind
of thing in the POM.

Anyone got any ideas?

-- 
Mark Raynsford | https://www.io7m.com

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org