Fix the Jenkins "No such DSL method with Maven found" error example

Fix the ‘No withMaven DSL method’ error

Let me guess, you’ve just run a Jenkins Maven build pipeline and you’re getting the following error

NoSuchMethodError: No such DSL method 'withMaven' found among steps
Jenkins withMaven Error Fix

Fix Jenkins’ withMaven NoSuchMethodError in DSL found by installing the Maven pipeline plugin.

Don’t fret. There’s an easy fix.

The Jenkins NoSuchMethodError fix

Just install the Jenkins Pipeline Apache Maven Integration plugin. Not the Maven Integration Pipeline. You likely already have that installed. But that’s the wrong plugin if you want to use a scripted or declarative pipeline that uses the Maven plugin. Not the Maven Integration plugin.

Once the correct Jenkins plugin is installed, trigger the build again and you will notice the no such DSL method with maven found error will go away.


Cameron McKenzie Cameron McKenzie is an AWS Certified AI Practitioner, Machine Learning Engineer, Solutions Architect and author of many popular books in the software development and Cloud Computing space. His growing YouTube channel training devs in Java, Spring, AI and ML has well over 30,000 subscribers.