(cross post
<https://community.jenkins.io/t/solving-failing-parent-pom-upgrade-from-4-51-to-4-52-cheatsheet/4958>
from community.jenkins.io)

If you are like me,

   - wondering why your dependabot PR builds are suddenly failing,
   - unsure of the full implications of the latest plugin parent pom
   upgrade,
   - and fear to waste time solving a problem that others have already
   solved,
   - don’t trust your memory when having several plugins to maintain.


Here are my notes on how to move ahead.


Background:
Easily overlooked, the bump of plugin from 4.51 to 4.52
<https://github.com/jenkinsci/plugin-pom/releases/tag/plugin-4.52> has a
breaking change. The plugin build toolchain now requires at least Java 11
and at least Jenkins 2.361.


Solution:

   - Make sure to use the correct Jenkins baseline
   - Disable builds with Java 8


Checklist:

In the plugin’s pom.xml,

   - Update the parent.pom (in the <parent> section) to 4.52
   - Change the Jenkins base version (<jenkins.version> property) to 2.361.4
   - Make sure that 2.361.x BOM is used (
   <artifactId>bom-2.361.x</artifactId> and
   <version>1723.vcb_9fee52c9fc</version>)
   - Make sure that the pom.xml doesn’t force a Java 1.8 compilation

Make sure that Jenkinsfile specifies builds with the supported JDKs.
(Relying on unknown defaults can bite you.) Your Jenkinsfile should look
like this:

buildPlugin(
   useContainerAgent: true,
   configurations: [
      [platform: 'linux', jdk: 17],
      [platform: 'windows', jdk: 11],
   ]
)


Note:
If you don’t find the above mentioned elements in the pom.xml of the plugin
you maintain, it is probably up for some tidying and “modernization”. See
the Improve a Plugin Tutorial
<https://www.jenkins.io/doc/developer/tutorial-improve/> for hints.

If you have doubts or this checklist doesn’t work for you, don’t hesitate
to discuss the matter on the developer mailing list.

/- Jmm

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CABLvyXxOFqBAA1FGJSPQqE-LQmwViTvdtVK%3DZtpw9JqwpqCPvA%40mail.gmail.com.

Reply via email to