[ANN] Apache Maven Toolchains Plugin 3.2.0

2024-04-21 Thread Olivier Lamy
The Apache Maven team is pleased to announce the release of the Apache
Maven Toolchains Plugin, version 3.2.o

The Toolchains Plugins enable sharing tool configuration across
plugins. For example, to make sure that plugins like compiler,
surefire, and javadoc all use the same JDK for execution,
independently from JRE used to run Maven itself.

https://maven.apache.org/plugins/maven-toolchains-plugin/

You should specify the version in your project's plugin configuration:


  org.apache.maven.plugins
  maven-toolchains-plugin
  3.2.0


You can download the appropriate sources etc. from the download page:

https://maven.apache.org/plugins/maven-toolchains-plugin/download.cgi

Release Notes - Maven Toolchains Plugin - Version 3.2.0

** Improvement
* [MTOOLCHAINS-49] - Automatic discovery of JDK toolchains

** Bug
* [MTOOLCHAINS-41] - Broken link to JDK toolchain version range definitions

** Task
* [MTOOLCHAINS-43] - Cleanup - Pom

** Dependency upgrade
* [MTOOLCHAINS-42] - Upgrade maven-plugin parent to 37
* [MTOOLCHAINS-45] - Upgrade maven-plugin parent to 39
* [MTOOLCHAINS-50] - Upgrade to maven parent 41
* [MTOOLCHAINS-51] - Upgrade to maven 3.9.6 at compile time and
3.6.3 at runtime

Enjoy,

-The Apache Maven team

-
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 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: Can properties be inherited like I expect them to be?

2024-04-21 Thread Gary Gregory
Hi Tamas,

Thank you for looking into this!

Gary

On Sun, Apr 21, 2024 at 10:27 AM Tamás Cservenák  wrote:
>
> Howdy,
>
> I did locally this
> https://gist.github.com/cstamas/25f6c978d3eb0823fd0af8ef25c08d6f
>
> And I think I got the behaviour that you expect.
>
> Given a project can be built only with Java8+ this should be ok.
>
> T
>
> On Sun, Apr 21, 2024 at 4:03 PM Gary Gregory  wrote:
>
> > Hi,
> >
> > A POM can't seem to inherit a parent POM configuration with properties
> > redefined in a child POM profile.
> >
> > Am I doing something wrong?
> >
> > For example:
> >
> > git clone https://gitbox.apache.org/repos/asf/commons-bcel.git
> > cd commons-bcel
> > git checkout eba45c05365fc89b0007296fc3ee188cca5d091d
> > maven
> >
> > This REQUIRES using Java 8, run the default goal: `mvn`
> >
> > and you'll get JaCoCo check failures because properties like
> > commons.jacoco.classRatio are not (apparently) overridden in the Java
> > 8 profile (id java-8) from 0.90 to 0.89.
> >
> > [INFO] Loading execution data file
> > /Users/garydgregory/git/commons-bcel/target/jacoco.exec
> > [INFO] Analyzed bundle 'bcel' with 408 classes
> > [WARNING] Rule violated for bundle bcel: classes covered ratio is
> > 0.89, but expected minimum is 1.00
> > [WARNING] Rule violated for bundle bcel: instructions covered ratio is
> > 0.65, but expected minimum is 0.90
> > [WARNING] Rule violated for bundle bcel: methods covered ratio is
> > 0.70, but expected minimum is 0.95
> > [WARNING] Rule violated for bundle bcel: branches covered ratio is
> > 0.59, but expected minimum is 0.85
> > [WARNING] Rule violated for bundle bcel: lines covered ratio is 0.68,
> > but expected minimum is 0.90
> > [WARNING] Rule violated for bundle bcel: complexity covered ratio is
> > 0.58, but expected minimum is 0.85
> >
> > Is there a way to get this to work?
> >
> > TY,
> > Gary
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >

-
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
>
>


Re: Can properties be inherited like I expect them to be?

2024-04-21 Thread Tamás Cservenák
Howdy,

I did locally this
https://gist.github.com/cstamas/25f6c978d3eb0823fd0af8ef25c08d6f

And I think I got the behaviour that you expect.

Given a project can be built only with Java8+ this should be ok.

T

On Sun, Apr 21, 2024 at 4:03 PM Gary Gregory  wrote:

> Hi,
>
> A POM can't seem to inherit a parent POM configuration with properties
> redefined in a child POM profile.
>
> Am I doing something wrong?
>
> For example:
>
> git clone https://gitbox.apache.org/repos/asf/commons-bcel.git
> cd commons-bcel
> git checkout eba45c05365fc89b0007296fc3ee188cca5d091d
> maven
>
> This REQUIRES using Java 8, run the default goal: `mvn`
>
> and you'll get JaCoCo check failures because properties like
> commons.jacoco.classRatio are not (apparently) overridden in the Java
> 8 profile (id java-8) from 0.90 to 0.89.
>
> [INFO] Loading execution data file
> /Users/garydgregory/git/commons-bcel/target/jacoco.exec
> [INFO] Analyzed bundle 'bcel' with 408 classes
> [WARNING] Rule violated for bundle bcel: classes covered ratio is
> 0.89, but expected minimum is 1.00
> [WARNING] Rule violated for bundle bcel: instructions covered ratio is
> 0.65, but expected minimum is 0.90
> [WARNING] Rule violated for bundle bcel: methods covered ratio is
> 0.70, but expected minimum is 0.95
> [WARNING] Rule violated for bundle bcel: branches covered ratio is
> 0.59, but expected minimum is 0.85
> [WARNING] Rule violated for bundle bcel: lines covered ratio is 0.68,
> but expected minimum is 0.90
> [WARNING] Rule violated for bundle bcel: complexity covered ratio is
> 0.58, but expected minimum is 0.85
>
> Is there a way to get this to work?
>
> TY,
> Gary
>
> -
> 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



Can properties be inherited like I expect them to be?

2024-04-21 Thread Gary Gregory
Hi,

A POM can't seem to inherit a parent POM configuration with properties
redefined in a child POM profile.

Am I doing something wrong?

For example:

git clone https://gitbox.apache.org/repos/asf/commons-bcel.git
cd commons-bcel
git checkout eba45c05365fc89b0007296fc3ee188cca5d091d
maven

This REQUIRES using Java 8, run the default goal: `mvn`

and you'll get JaCoCo check failures because properties like
commons.jacoco.classRatio are not (apparently) overridden in the Java
8 profile (id java-8) from 0.90 to 0.89.

[INFO] Loading execution data file
/Users/garydgregory/git/commons-bcel/target/jacoco.exec
[INFO] Analyzed bundle 'bcel' with 408 classes
[WARNING] Rule violated for bundle bcel: classes covered ratio is
0.89, but expected minimum is 1.00
[WARNING] Rule violated for bundle bcel: instructions covered ratio is
0.65, but expected minimum is 0.90
[WARNING] Rule violated for bundle bcel: methods covered ratio is
0.70, but expected minimum is 0.95
[WARNING] Rule violated for bundle bcel: branches covered ratio is
0.59, but expected minimum is 0.85
[WARNING] Rule violated for bundle bcel: lines covered ratio is 0.68,
but expected minimum is 0.90
[WARNING] Rule violated for bundle bcel: complexity covered ratio is
0.58, but expected minimum is 0.85

Is there a way to get this to work?

TY,
Gary

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