Requiring Apache Maven 3.9.6?

147 views
Skip to first unread message

Guillaume Smet

unread,
Jun 18, 2024, 3:35:24 AMJun 18
to Quarkus Development mailing list
Hi,

We are not usually being too aggressive for our Maven requirements but... in this case we have a very good reason: Apache Maven 3.9.5- doesn't support Maven plugins compiled with Java 17.

For now, we worked around the limitation by compiling the plugins for Java 11 but it's not sustainable, especially since when you are using Java 11 and trying to build a Quarkus app, you end up with a very confusing error at the moment (this happened a few times in a workshop not so long ago).
Sometimes, it's even trickier especially on Windows, because it can happen the Java version you get when doing `java -version` is not actually the one used by Maven (that you can see with mvn -v).

If we were compiling the plugins for Java 17, I *think* the error would be a bit better (it will probably complain about the class format, which is a well documented error).

So I would like to suggest that we make Apache Maven 3.9.6, which was released in December 2023 and is 6 months old, our new minimum Maven version starting with Quarkus 3.13.

That would make our full build consistent and targeting Java 17.

Yeah or nah?

--
Guillaume

Rostislav Svoboda

unread,
Jun 18, 2024, 6:42:40 AMJun 18
to guillau...@gmail.com, Quarkus Development mailing list
Hi Guillaume.

Any idea how would this manifest to users which would be using 3.8.x or even 3.6.x?

Would be `quarkus update` able to adjust mvnw to push 3.9.6 version?

On Quarkus main I guess there would be enforcer rule or something like that.

Rostislav

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo9%2BjHYrwMD2UAfj6OJXgQcWCu3LoLkwaSw98hrz8AHU7g%40mail.gmail.com.

Martin Kouba

unread,
Jun 18, 2024, 7:21:06 AMJun 18
to guillau...@gmail.com, Quarkus Development mailing list
Is it a Maven version required to build Quarkus itself or a Quarkus app?

BTW it seems that our docs require Apache Maven 3.9.6 already...

>
> That would make our full build consistent and targeting Java 17.
>
> Yeah or nah?
>
> --
> Guillaume
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo9%2BjHYrwMD2UAfj6OJXgQcWCu3LoLkwaSw98hrz8AHU7g%40mail.gmail.com <https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo9%2BjHYrwMD2UAfj6OJXgQcWCu3LoLkwaSw98hrz8AHU7g%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Martin Kouba
Principal Software Engineer
Red Hat, Czech Republic

Guillaume Smet

unread,
Jun 18, 2024, 8:33:46 AMJun 18
to Rostislav Svoboda, Quarkus Development mailing list
On Tue, Jun 18, 2024 at 12:42 PM Rostislav Svoboda <rsvo...@redhat.com> wrote:
Any idea how would this manifest to users which would be using 3.8.x or even 3.6.x?

Badly.
You get a weird error telling that some SISU dependencies are not available:
=======
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) [Guice/MissingImplementation]: No implementation for QuarkusBootstrapProvider annotated with interface TypeArguments$Implicit was bound.

Did you mean?
    QuarkusBootstrapProvider bound at LocatorWiring
=======

Fortunately, we can enforce a minimum Java version in our Maven plugins and in this case, you get the weird error above... but the last thing you see at the bottom of your build is:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:generate-code (default) on project code-with-quarkus: The plugin io.quarkus:quarkus-maven-plugin:999-SNAPSHOT requires Maven version 3.9.8 -> [Help 1]

Which indicates the very cause of the issues as the first thing you see when you have a look at the error. So I think it would be good enough (TM).
 
Would be `quarkus update` able to adjust mvnw to push 3.9.6 version?

I fixed a few things in this area in OpenRewrite and it should work in most cases.

-- 
Guillaume

Guillaume Smet

unread,
Jun 18, 2024, 8:34:48 AMJun 18
to Martin Kouba, Quarkus Development mailing list
On Tue, Jun 18, 2024 at 1:21 PM Martin Kouba <mko...@redhat.com> wrote:
Is it a Maven version required to build Quarkus itself or a Quarkus app?

That would be both.

As long as we ship our plugins with Java 17, only Maven 3.9.6+ can run the plugins.

BTW it seems that our docs require Apache Maven 3.9.6 already...

I was a bit surprised so I had a look.

This version comes from `proposed-maven-version` which is the version used for the Maven wrapper and the latest that we tested, so it kinda makes sense to use this version in the doc.

But for now, we actually require:
<maven.min.version>3.8.6</maven.min.version>

My proposal is really about making Maven 3.9.6 a strong prerequisite for building anything Quarkus (the project and any Quarkus app).

--
Guillaume

Jorge Solórzano

unread,
Jun 19, 2024, 5:40:48 AMJun 19
to Quarkus Development mailing list
My two cents:

Since Quarkus already provides the Maven Wrapper, I don't see any advantage of using an old version of Maven; in 99% of the cases, updating Maven should not break anything for end users, and Maven should be treated also as a dependency that must be updated form time to time.

In this line, I would be more aggressive as don't see any reason to not go for 3.9.8 which contains additional fixes, and also has a companion mvnd 1.0.0.

Kind regards,

Max Rydahl Andersen

unread,
Jun 20, 2024, 7:57:55 AM (14 days ago) Jun 20
to Jorge Solórzano, Quarkus Development mailing list


> My two cents:
>
> Since Quarkus already provides the Maven Wrapper, I don't see any advantage
> of using an old version of Maven; in 99% of the cases, updating Maven
> should not break anything for end users, and Maven should be treated also
> as a dependency that must be updated form time to time.

Correct, but some places specific versions of Java is enforced.

> In this line, I would be more aggressive as don't see any reason to not go
> for 3.9.8 which contains additional fixes, and also has a companion mvnd
> 1.0.0.

the minimum version is not the same as recommended.

do we have any known issue with using mvnd 1.0 with Quarkus?


/max

> Kind regards,
>
> On Tuesday, June 18, 2024 at 2:34:48 PM UTC+2 Guillaume Smet wrote:
>
> On Tue, Jun 18, 2024 at 1:21 PM Martin Kouba <mko...@redhat.com> wrote:
>
> Is it a Maven version required to build Quarkus itself or a Quarkus app?
>
>
> That would be both.
>
> As long as we ship our plugins with Java 17, only Maven 3.9.6+ can run the
> plugins.
>
> BTW it seems that our docs require Apache Maven 3.9.6 already...
>
>
> I was a bit surprised so I had a look.
>
> This version comes from `proposed-maven-version` which is the version used
> for the Maven wrapper and the latest that we tested, so it kinda makes
> sense to use this version in the doc.
>
> But for now, we actually require:
> <maven.min.version>3.8.6</maven.min.version>
>
> My proposal is really about making Maven 3.9.6 a strong prerequisite for
> building anything Quarkus (the project and any Quarkus app).
>
> --
> Guillaume
>
> --
> You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/d21b8346-ca00-4848-ad91-9de4d901d1e8n%40googlegroups.com.

Max Rydahl Andersen

unread,
Jun 20, 2024, 8:07:38 AM (14 days ago) Jun 20
to Guillaume Smet, Quarkus Development mailing list

On 18 Jun 2024, at 9:34, Guillaume Smet wrote:

> Hi,
>
> We are not usually being too aggressive for our Maven requirements but...
> in this case we have a very good reason: Apache Maven 3.9.5- doesn't
> support Maven plugins compiled with Java 17.

remind me - is it really that older Maven version does not work with Java 17 compiled plugins
or more that the error message is bad if you run mvn with non-java 17 java?

afaik older maven's works with Java 17 as long as you are running mvn itself with Java 17+, right?

The issue is more that Apache Maven 3.9.5- sucks give a good error message if you run with
older Java versions, right?

> For now, we worked around the limitation by compiling the plugins for Java
> 11 but it's not sustainable, especially since when you are using Java 11
> and trying to build a Quarkus app, you end up with a very confusing error
> at the moment (this happened a few times in a workshop not so long ago).
> Sometimes, it's even trickier especially on Windows, because it can happen
> the Java version you get when doing `java -version` is not actually the one
> used by Maven (that you can see with mvn -v).
>
> If we were compiling the plugins for Java 17, I *think* the error would be
> a bit better (it will probably complain about the class format, which is a
> well documented error).

>
> So I would like to suggest that we make Apache Maven 3.9.6, which was
> released in December 2023 and is 6 months old, our new minimum Maven
> version starting with Quarkus 3.13.
>
> That would make our full build consistent and targeting Java 17.
>
> Yeah or nah?

Other alternative is that we compile the plugins with 17..then most users
can use it; but yes the error will be bad but at least it will eventually be
easy to find as many others will have this with many other fwks, right?


/max

Guillaume Smet

unread,
Jun 20, 2024, 8:20:55 AM (14 days ago) Jun 20
to Max Rydahl Andersen, Quarkus Development mailing list
On Thu, Jun 20, 2024 at 2:07 PM Max Rydahl Andersen <mand...@redhat.com> wrote:
On 18 Jun 2024, at 9:34, Guillaume Smet wrote:
> We are not usually being too aggressive for our Maven requirements but...
> in this case we have a very good reason: Apache Maven 3.9.5- doesn't
> support Maven plugins compiled with Java 17.

remind me - is it really that older Maven version does not work with Java 17 compiled plugins
or more that the error message is bad if you run mvn with non-java 17 java?
afaik older maven's works with Java 17 as long as you are running mvn itself with Java 17+, right?

My experience is that if the plugin is compiled with Java 17, even running with Java 17 won't work.

Our CI was failing and it was using the same JDK for building the Maven plugin and running the tests.
 
The issue is more that Apache Maven 3.9.5- sucks give a good error message if you run with
older Java versions, right?

Nope. My experience is that it doesn't work at all and fails with a very cryptic error message.
 
Other alternative is that we compile the plugins with 17..then most users
can use it; but yes the error will be bad but at least it will eventually be
easy to find as many others will have this with many other fwks, right?

I'm not sure what you're saying here but my understanding is that if you build the plugins with Java 17, you need Apache Maven 3.9.6 to consume them.

Thus this email.

--
Guillaume

Guillaume Smet

unread,
Jun 20, 2024, 8:22:11 AM (14 days ago) Jun 20
to mand...@redhat.com, Jorge Solórzano, Quarkus Development mailing list
On Thu, Jun 20, 2024 at 1:57 PM Max Rydahl Andersen <mand...@redhat.com> wrote:
> In this line, I would be more aggressive as don't see any reason to not go
> for 3.9.8 which contains additional fixes, and also has a companion mvnd
> 1.0.0.

the minimum version is not the same as recommended.

do we have any known issue with using mvnd 1.0 with Quarkus?

Yes. We had to fix something in SmallRye BeanBag for Quarkus Maven plugins to work with mvnd 1.0.
The fix has been backported to 3.11.3.

-- 
Guillaume

Max Rydahl Andersen

unread,
Jun 20, 2024, 8:56:29 AM (14 days ago) Jun 20
to Guillaume Smet, Quarkus Development mailing list
>> On 18 Jun 2024, at 9:34, Guillaume Smet wrote:
>>> We are not usually being too aggressive for our Maven requirements but...
>>> in this case we have a very good reason: Apache Maven 3.9.5- doesn't
>>> support Maven plugins compiled with Java 17.
>>
>> remind me - is it really that older Maven version does not work with Java
>> 17 compiled plugins
>> or more that the error message is bad if you run mvn with non-java 17 java?
>> afaik older maven's works with Java 17 as long as you are running mvn
>> itself with Java 17+, right?
>>
>
> My experience is that if the plugin is compiled with Java 17, even running
> with Java 17 won't work.

That isn't what I would expect - so I got curious and I created https://github.com/maxandersen/hello-maven-plugin
and I can run that with Java 17 and 21 using just mvn 3.8.6.

> Our CI was failing and it was using the same JDK for building the Maven
> plugin and running the tests.

There must be something more to it than just Java 17.

If I get into using Java 11 then yes, errors are really weird - but its not class format issue:

I get "[WARNING] Error injecting: sample.plugin.MyMojo
java.lang.TypeNotPresentException: Type sample.plugin.MyMojo not present
at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:147)"

Might be my basic java 17 sample here is not enough but it's something more than just targeting java 17.

I would like us to grok what that is - since otherwise we still have similar issue;
as it won't really be much better with 3.9.6 too.

/max

Max Rydahl Andersen

unread,
Jun 20, 2024, 9:21:04 AM (13 days ago) Jun 20
to Guillaume Smet, Quarkus Development mailing list
I just built quarkus maven plugin with Java 17 and used maven 3.8.6 and use quarkus create app using 999-SNAPSHOT.

Run with Java 11: fails as expected with bad error message.

Run with Java 17+: works.

Thus I can't reproduce the issue unless I as user run with bad Java version.

Thus not seeing a value/difference to require 3.9.6 - its the same no matter
maven version I use?

What am I missing?

/max

Guillaume Smet

unread,
Jun 20, 2024, 9:22:07 AM (13 days ago) Jun 20
to Max Rydahl Andersen, Quarkus Development mailing list
On Thu, Jun 20, 2024 at 2:56 PM Max Rydahl Andersen <mand...@redhat.com> wrote:
That isn't what I would expect - so I got curious and I created https://github.com/maxandersen/hello-maven-plugin
and I can run that with Java 17 and 21 using just mvn 3.8.6.

Well, given it was related to SISU injection, your plugin might be too small to actually trigger the issue.

So maybe try with our plugins instead?

Guillaume Smet

unread,
Jun 20, 2024, 9:23:44 AM (13 days ago) Jun 20
to Max Rydahl Andersen, Quarkus Development mailing list
On Thu, Jun 20, 2024 at 3:21 PM Max Rydahl Andersen <mand...@redhat.com> wrote:
What am I missing?

Not sure. But I know our CI wasn't passing when the plugins were built with Java 11.

It might now given we updated the wrapper to 3.9.8.

I would point to the original issue but IIRC it was in some dependencies of Maven so it's not easy to find.

Max Rydahl Andersen

unread,
Jun 20, 2024, 9:30:01 AM (13 days ago) Jun 20
to Guillaume Smet, Quarkus Development mailing list


On 20 Jun 2024, at 15:23, Guillaume Smet wrote:

> On Thu, Jun 20, 2024 at 3:21 PM Max Rydahl Andersen <mand...@redhat.com>
> wrote:
>
>> What am I missing?
>>
>
> Not sure. But I know our CI wasn't passing when the plugins were built with
> Java 11.
>
> It might now given we updated the wrapper to 3.9.8.

I used a set of sdkman installed mvn directly and just worked.

> I would point to the original issue but IIRC it was in some dependencies of
> Maven so it's not easy to find.

k - but assuming we have no reasons to move to java 17 for compiler plugin we don't improve situation anyway.

if/when java 17 in plugin is needed then opening PR just changing the compiler target on the plugin
should show if there is still some deeper issue?

At least lets see build fail before raising minimal mvn version IMO.

/max

Jorge Solórzano

unread,
Jun 20, 2024, 10:41:34 AM (13 days ago) Jun 20
to guillau...@gmail.com, Max Rydahl Andersen, Quarkus Development mailing list
Just to provide some context on the issue:

Maven version before 3.9.6 uses Eclipse Sisu 0.3.5, and in turn, uses an older version of ASM that reads bytecode up to Java 14.
Plugins that are compiled with newer versions of Java than supported by Sisu (Java 14) could fail, normally this is no issue since most of the maven plugins target Java 8 or even Java 11, but plugins that target Java 17 could have issues because the class reader fails to read the bytecode correctly.

Maven versions 3.9.6 and 3.9.7 use Eclipse Sisu 0.9.0.M2, and this version uses ASM 9.5 which can read class files up to Java 21.

Maven version 3.9.8 uses Eclipse Sisu 0.9.0.M3 with ASM 9.7 supporting up to Java 23.

To trigger this issue you need a component as Tamás mentioned: https://github.com/maxandersen/hello-maven-plugin/issues/1

On a side note in case the Tamás mail got lost, mvnd 1.0.1 will be out very soon: https://github.com/apache/maven-mvnd/milestone/41
fixing two issues reported:
* terminal on windows is busted (works only as "dumb" when native mvnd.exe used)
* archetype:generate failed due bug in client message handling

--
You received this message because you are subscribed to a topic in the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/quarkus-dev/XU8i2tCEVPA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo8%2BPwKY_ry5DmprX%3D0_Qs2JAP0qzBiQSbswdHH57ULSkg%40mail.gmail.com.

Max Rydahl Andersen

unread,
Jun 20, 2024, 11:21:49 AM (13 days ago) Jun 20
to Jorge Solórzano, guillau...@gmail.com, Quarkus Development mailing list
> Just to provide some context on the issue:
>
> Maven version before 3.9.6 uses Eclipse Sisu 0.3.5, and in turn, uses an
> older version of ASM that reads bytecode up to Java 14.
> Plugins that are compiled with newer versions of Java than supported by
> Sisu (Java 14) could fail, normally this is no issue since most of the
> maven plugins target Java 8 or even Java 11, but plugins that target Java
> 17 could have issues because the class reader fails to read the bytecode
> correctly.
>
> Maven versions 3.9.6 and 3.9.7 use Eclipse Sisu 0.9.0.M2, and this version
> uses ASM 9.5 which can read class files up to Java 21.
>
> Maven version 3.9.8 uses Eclipse Sisu 0.9.0.M3 with ASM 9.7 supporting up
> to Java 23.
>
> To trigger this issue you need a component as Tamás mentioned:
> https://github.com/maxandersen/hello-maven-plugin/issues/1

I compiled quarkus maven plugin with java 17 and couldn't reproduce it ...
now i'm curious what step I'm missing to trigger it.

mvn package in a quarkus app wasn't enough to make 3.8.6 fail for me.

only fails if I move to run with Jvm lower than 11.

In any case, any chance you have a jira or GitHub issue or even release notes
somehow pointing out Java 17 is not working before 3.9.6? That I can use to
poke at others to upgrade faster :)

> On a side note in case the Tamás mail got lost, mvnd 1.0.1 will be out very
> soon: https://github.com/apache/maven-mvnd/milestone/41
> fixing two issues reported:
> * terminal on windows is busted (works only as "dumb" when native mvnd.exe
> used)
> * archetype:generate failed due bug in client message handling

cool!

> On Thu, Jun 20, 2024 at 3:23 PM Guillaume Smet <guillau...@gmail.com>
> wrote:
>
>> On Thu, Jun 20, 2024 at 3:21 PM Max Rydahl Andersen <mand...@redhat.com>
>> wrote:
>>
>>> What am I missing?
>>>
>>
>> Not sure. But I know our CI wasn't passing when the plugins were built
>> with Java 11.
>>
>> It might now given we updated the wrapper to 3.9.8.
>>
>> I would point to the original issue but IIRC it was in some dependencies
>> of Maven so it's not easy to find.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Quarkus Development mailing list" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/quarkus-dev/XU8i2tCEVPA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> quarkus-dev...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo8%2BPwKY_ry5DmprX%3D0_Qs2JAP0qzBiQSbswdHH57ULSkg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo8%2BPwKY_ry5DmprX%3D0_Qs2JAP0qzBiQSbswdHH57ULSkg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>

Max Rydahl Andersen

unread,
Jun 21, 2024, 4:30:20 AM (13 days ago) Jun 21
to Jorge Solórzano, guillau...@gmail.com, Quarkus Development mailing list
ok so with https://github.com/maxandersen/hello-maven-plugin/pull/2 I can reproduce it for hello world.

sisu causing troubles.

Still haven't been able to trigger the quarkus plugin which is weird.

If anyone know of maven/sisu jiras I would love to get them to help prioritize it up for UBI images :)

Do we have any known things that needs java 17 in the maven plugins?

/max

Tamás Cservenák

unread,
Jun 23, 2024, 9:50:31 AM (10 days ago) Jun 23
to mand...@redhat.com, Jorge Solórzano, Quarkus Development mailing list
Howdy,

we are planning mvnd 1.0.1 very soon:

There were two issues reported:
* terminal on windows is busted (works only as "dumb" when native mvnd.exe used)
* archetype:generate failed due bug in client message handling

Thanks
T

Tamás Cservenák

unread,
Jun 23, 2024, 9:50:34 AM (10 days ago) Jun 23
to jor...@gmail.com, Quarkus Development mailing list
Sorry Jorsol for duplicate (but this identity of mine was not yet member of Q-dev ML):

Just 5cents: 
Mvn 3.9.8 contains ASM 9.7 (Eclipse Sisu is the culprit here, and is the sole user of ASM, so Sisu components now can be up to Java 23).
FTR re mvnd 1.0.0, it seems console of it is busted on Windows: see https://github.com/apache/maven-mvnd/issues/1032
mvnd 1.0.1 is being worked on...

Thanks
T

On Wed, Jun 19, 2024 at 11:43 AM Tamás Cservenák <ta...@cservenak.net> wrote:
Just 5cents: 
And 3.9.8 contains ASM 9.7 (Eclipse Sisu is the culprit here, and is the user of ASM, so Sisu components now can be up to Java 23).
re mvnd 1.0.0, it seems console of it is busted on Win (at least the console output): see https://github.com/apache/maven-mvnd/issues/1032

Thanks
T

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/d21b8346-ca00-4848-ad91-9de4d901d1e8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages