Error during Plugin Upgrade from 2.440.3 to 2.479.1

Hello,
I encountered an error while upgrading my plugin from version 2.440.3 to 2.479.1. Here are the details:

[WARNING] Failed startup of context o.e.j.m.p.MavenWebAppContext@52180c86{Jenkins v2.479.1,/jenkins,file:///C:/Users/Vaibhav.Dubey/Desktop/Jenkins%20Plugin/demo/target/jetty/webapp/,UNAVAILABLE}{C:\Users\Vaibhav.Dubey\.m2\repository\org\jenkins-ci\main\jenkins-war\2.479.1\jenkins-war-2.479.1.war}
java.lang.NoClassDefFoundError: jakarta/servlet/ServletContextListener
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1026)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
	at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass(WebAppClassLoader.java:594)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadAsResource(WebAppClassLoader.java:567)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:502)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
	at org.eclipse.jetty.util.Loader.loadClass(Loader.java:59)
	at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:97)
	at org.eclipse.jetty.servlet.ListenerHolder.doStart(ListenerHolder.java:69)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:382)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1304)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:901)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:306)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:532)
	at org.eclipse.jetty.maven.plugin.MavenWebAppContext.doStart(MavenWebAppContext.java:294)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
	at org.eclipse.jetty.server.Server.start(Server.java:470)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
	at org.eclipse.jetty.server.Server.doStart(Server.java:415)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at org.eclipse.jetty.maven.plugin.JettyEmbedder.doStart(JettyEmbedder.java:224)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
	at org.eclipse.jetty.maven.plugin.JettyRunWarMojo.startJettyEmbedded(JettyRunWarMojo.java:96)
	at org.eclipse.jetty.maven.plugin.AbstractWebAppMojo.startJetty(AbstractWebAppMojo.java:441)
	at org.jenkinsci.maven.plugins.hpi.RunMojo.startJetty(RunMojo.java:813)
	at org.eclipse.jetty.maven.plugin.AbstractWebAppMojo.execute(AbstractWebAppMojo.java:419)
	at org.jenkinsci.maven.plugins.hpi.RunMojo.execute(RunMojo.java:427)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
	at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
	at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
	at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
Caused by: java.lang.ClassNotFoundException: jakarta.servlet.ServletContextListener
	at org.jenkinsci.maven.plugins.hpi.JettyAndServletApiOnlyClassLoader.findClass(JettyAndServletApiOnlyClassLoader.java:38)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:595)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:511)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528)
	... 69 more

My pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>4.85</version>
    <relativePath />
  </parent>

  <groupId>io.jenkins.plugins</groupId>
  <artifactId>demo</artifactId>
  <version>${revision}${changelist}</version>
  <packaging>hpi</packaging>

  <name>TODO Plugin</name>
  <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/license/mit/</url>
    </license>
  </licenses>
  <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
    <connection>scm:git:https://github.com/${gitHubRepo}</connection>
    <developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
    <tag>${scmTag}</tag>
    <url>https://github.com/${gitHubRepo}</url>
  </scm>

  <properties>
    <revision>1.0</revision>
    <changelist>-SNAPSHOT</changelist>

    <!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
    <jenkins.version>2.479.1</jenkins.version>
    <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>

    <spotless.check.skip>false</spotless.check.skip>
    
  </properties>

  <dependencyManagement>
    <dependencies>
		<!-- https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api -->
	<dependency>
	    <groupId>jakarta.servlet</groupId>
	    <artifactId>jakarta.servlet-api</artifactId>
	    <version>6.1.0</version>
	    <scope>provided</scope>
	</dependency> 

      <dependency>
        <!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
        <groupId>io.jenkins.tools.bom</groupId>
        <artifactId>bom-2.440.x</artifactId>
        <version>3193.v330d8248d39e</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-basic-steps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-cps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-durable-task-step</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-job</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>
</project>

You need to upgrade the parent pom to version 5.4
Also align the bom in the dependencyManagement section accordingly to use bom-2.479.x
Then you can remove the explicit jakarta.servlet dependency there as well

Hey Markus,
After the changes these errors are coming

[ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: hpi @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 15, column 14
[ERROR] Non-resolvable import POM: The following artifacts could not be resolved: io.jenkins.tools.bom:bom-2.479.x:pom:3193.v330d8248d39e (absent): io.jenkins.tools.bom:bom-2.479.x:pom:3193.v330d8248d39e was not found in https://repo.jenkins-ci.org/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 46, column 19
[ERROR] 'dependencies.dependency.version' for org.jenkins-ci.plugins:structs:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 57, column 17
[ERROR] 'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-basic-steps:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 61, column 17
[ERROR] 'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-cps:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 66, column 17
[ERROR] 'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-durable-task-step:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 71, column 17
[ERROR] 'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-job:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 76, column 17
 @ 
[ERROR] The build could not read 1 project -> [Help 1]   
[ERROR]   The project io.jenkins.plugins:demo:1.0-SNAPSHOT (C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml) has 7 errors
[ERROR]     Unknown packaging: hpi @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 15, column 14
[ERROR]     Non-resolvable import POM: The following artifacts could not be resolved: io.jenkins.tools.bom:bom-2.479.x:pom:3193.v330d8248d39e (absent): io.jenkins.tools.bom:bom-2.479.x:pom:3193.v330d8248d39e was not found in https://repo.jenkins-ci.org/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 46, column 19 -> e[1m[Help 2]e[m
[ERROR]     'dependencies.dependency.version' for org.jenkins-ci.plugins:structs:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 57, column 17
[ERROR]     'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-basic-steps:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 61, column 17
[ERROR]     'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-cps:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 66, column 17
[ERROR]     'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-durable-task-step:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 71, column 17
[ERROR]     'dependencies.dependency.version' for org.jenkins-ci.plugins.workflow:workflow-job:jar is missing. @ io.jenkins.plugins:demo:${revision}${changelist}, C:\Users\Vaibhav.Dubey\Desktop\Jenkins Plugin\demo\pom.xml, line 76, column 17
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the e[1m-ee[m switch.
[ERROR] Re-run Maven using the  switch to enable full debug logging.

[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR]http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR]http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

here is my pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>5.4</version>
    <relativePath />
  </parent>

  <groupId>io.jenkins.plugins</groupId>
  <artifactId>demo</artifactId>
  <version>${revision}${changelist}</version>
  <packaging>hpi</packaging>

  <name>TODO Plugin</name>
  <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/license/mit/</url>
    </license>
  </licenses>
  <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
    <connection>scm:git:https://github.com/${gitHubRepo}</connection>
    <developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
    <tag>${scmTag}</tag>
    <url>https://github.com/${gitHubRepo}</url>
  </scm>

  <properties>
    <revision>1.0</revision>
    <changelist>-SNAPSHOT</changelist>

    <!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
    <jenkins.version>2.479.1</jenkins.version>
    <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>

    <spotless.check.skip>false</spotless.check.skip>
    
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
        <groupId>io.jenkins.tools.bom</groupId>
         <artifactId>bom-2.479.x</artifactId>
        <version>3193.v330d8248d39e</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-basic-steps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-cps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-durable-task-step</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-job</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>
</project>

The version of the bom is not correct. 3193.v330d8248d39e doesn’t exists for bom-2.479.x

get this same error after removing the version

You have to specify a version for the bom. The latest version is 3875.v1df09947cde6
Also make sure you’re using java17

Now I’m getting this error:
line 15 in pom.xml file is: hpi

line 15 in pom.xml file is: <packaging>hpi</packaging>

here my pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

 <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>5.4</version>
    <relativePath />
  </parent>

  <groupId>io.jenkins.plugins</groupId>
  <artifactId>OpkeyJenkinsPlugin</artifactId>
  <version>${revision}${changelist}</version>
  <packaging>hpi</packaging>

  <name>TODO Plugin</name>
  <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/license/mit/</url>
    </license>
  </licenses>
  <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
    <connection>scm:git:https://github.com/${gitHubRepo}</connection>
    <developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
    <tag>${scmTag}</tag>
    <url>https://github.com/${gitHubRepo}</url>
  </scm>

  <properties>
    <revision>1.0</revision>
    <changelist>-SNAPSHOT</changelist>

    <!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
    <jenkins.version>2.479.1</jenkins.version>
    <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
    <spotless.check.skip>false</spotless.check.skip>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
        <groupId>io.jenkins.tools.bom</groupId>
        <artifactId>bom-2.479.x</artifactId>
        <version>3875.v1df09947cde6</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-basic-steps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-cps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-durable-task-step</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-job</artifactId>
      <scope>test</scope>
    </dependency>




  </dependencies>

  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>
</project>

the pom.xml looks good I think.
Other things to check

  • You must be using maven 3.9.6 or higher
  • you must use java 17

I have maven version 3.9.9 & java 17, then how i fixed the error ?

run maven with -X to get debug output. Use -U to force update dependencies

Ensure that JAVA_HOME env variable also points to java 17

I have followed all your suggestions, but I am still getting the same error, even in the debug output

I took your pom.xml from here
This works fine on my machine.
So something else is wrong on your machine it’s not the pom

I get the error with the unknown packaging when java 11 is used.
So ensure that JAVA_HOME points to Java 17 and not Java 11

Hey Markus Winter, it’s working fine now. Thank you so much for your support!

Hey Markus,
My project runs fine, but sometimes this error occurs. I checked on different systems, and this error appears frequently. Sometimes the project runs fine, but other times the error occurs. Why is the project not consistent? I’m using Eclipse ID version Version: 2024-09 (4.33.0) & Build id: 20240905-0614

Line Number 21 Code: <packaging>hpi</packaging>
Here is my Pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

 <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>5.4</version>
    <relativePath />
  </parent>

  <groupId>io.jenkins.plugins</groupId>
  <artifactId>OpkeyJenkinsPlugin</artifactId>
  <version>${revision}${changelist}</version>
  <packaging>hpi</packaging> 

  <name>TODO Plugin</name>
  <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/license/mit/</url>
    </license>
  </licenses>
  <scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
    <connection>scm:git:https://github.com/${gitHubRepo}</connection>
    <developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
    <tag>${scmTag}</tag>
    <url>https://github.com/${gitHubRepo}</url>
  </scm>

  <properties>
    <revision>1.0</revision>
    <changelist>-SNAPSHOT</changelist>

    <!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
    <jenkins.version>2.479.2</jenkins.version>
    <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
    <spotless.check.skip>false</spotless.check.skip>
  </properties>

  <dependencyManagement>
	  
    <dependencies>
      <dependency>
        <!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
        <groupId>io.jenkins.tools.bom</groupId>
        <artifactId>bom-2.479.x</artifactId>
        <version>3875.v1df09947cde6</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-basic-steps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-cps</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-durable-task-step</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins.workflow</groupId>
      <artifactId>workflow-job</artifactId>
      <scope>test</scope>
    </dependency>




  </dependencies>

  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>
</project>