Skip to content

How can I import the Maven shade plugin properly?

I am very frustrated. I’ve spent a long time trying to compile a Maven project into an Uber/Fat jar file using the Maven shade plugin, but I still keep getting “mvn is not recognized as an internal or external command” error in command prompt. Here are the important bits of my pom.xml:

            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
              <mainClass>*my main class*</mainClass>

I don’t know what I’m doing wrong. I am going into my project’s directory using Windows Command Prompt and typed “mvn clean install” but it doesn’t seem to work. I am new to Maven, I generally use Gradle. Has the plugin not loaded? Am I doing something wrong? Or am I just being stupid as always?

Any help appreciated! Thanks in advance!



For Maven to work on command line, you need to

  • download and unzip it to some directory
  • Add the bin directory in that directory to your PATH

If you have done that, you may have a type or may need to restart your system.