Migration to Java11 and modules

17 views
Skip to first unread message

Ullrich Hafner

unread,
Jan 3, 2023, 8:08:02 AM1/3/23
to JenkinsCI Developers
I’m currently starting the Java 11 migration of my plugins and my local builds are failing due to several Java modules failures (package x.y.z is declared in the unnamed module, but a.b.c does not use it, error: module not found: x.y.z).

Do we already have some guidelines on how to migrate a plugin to Java 11? Do we need to create module-info.java files for plugins? How do we access libraries that use modules? Or has someone already finished the the migration so I can have a look at the necessary steps?



Tim Jacomb

unread,
Jan 3, 2023, 8:21:28 AM1/3/23
to jenkin...@googlegroups.com
I'm not aware of hitting any modules issues, this is the normal pull request that has been applied:

at a guess 30+ plugins with no issues, likely more.

On Tue, 3 Jan 2023 at 13:08, Ullrich Hafner <ullrich...@gmail.com> wrote:
I’m currently starting the Java 11 migration of my plugins and my local builds are failing due to several Java modules failures (package x.y.z is declared in the unnamed module, but a.b.c does not use it,  error: module not found: x.y.z).

Do we already have some guidelines on how to migrate a plugin to Java 11? Do we need to create module-info.java files for plugins? How do we access libraries that use modules? Or has someone already finished the the migration so I can have a look at the necessary steps?



--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/B889703A-0666-413D-A413-CEE697B9E36B%40gmail.com.

Jesse Glick

unread,
Jan 3, 2023, 9:42:18 AM1/3/23
to jenkin...@googlegroups.com
On Tue, Jan 3, 2023 at 8:08 AM Ullrich Hafner <ullrich...@gmail.com> wrote:
Do we already have some guidelines on how to migrate a plugin to Java 11?

Yes; normally there is very little to do.
 
Do we need to create module-info.java files for plugins?

No.
 
How do we access libraries that use modules?

Jenkins does not use the Java module system, so there should be no change from Java 8 usage modes. If there is some incompatibility in Java 11 in this regard, then you may be the first to encounter it so you will need to debug accordingly. Is this failure during the build itself, or in Surefire test runs? Without any details it is hard to even guess what is wrong.

Ullrich Hafner

unread,
Jan 3, 2023, 2:10:58 PM1/3/23
to JenkinsCI Developers

Am 03.01.2023 um 15:42 schrieb 'Jesse Glick' via Jenkins Developers <jenkin...@googlegroups.com>:

On Tue, Jan 3, 2023 at 8:08 AM Ullrich Hafner <ullrich...@gmail.com> wrote:
Do we already have some guidelines on how to migrate a plugin to Java 11?

Yes; normally there is very little to do.
 
Do we need to create module-info.java files for plugins?

No.
 
How do we access libraries that use modules?

Jenkins does not use the Java module system, so there should be no change from Java 8 usage modes. If there is some incompatibility in Java 11 in this regard, then you may be the first to encounter it so you will need to debug accordingly.

Ok, thanks for the info. Actually a bug in my own build chain. Somehow a module-info.class from one of my dependencies went into my classes folder and that caused the confusion for the Java compiler. Now everything works fine!

Is this failure during the build itself, or in Surefire test runs? Without any details it is hard to even guess what is wrong.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages