A MAVEN project has a lot of dependencies, so the final jar is usually a lot, and it's bigger, and the steps to make the jar package (note that the package type in the Pom.xml file cannot be a war package):
1. Make a jar of the libraries that depend on Pom.xml:
In the directory where the project Pom.xml is located, execute the command:
MVN dependency:copy-dependencies
The jar packages that you depend on are exported to the directory target/dependency/.
2. Make the MAVEN project into a jar package:
In the directory where the project Pom.xml is located, execute the command:
MVN Package
The project's jar package is exported to the directory target/.
3. Add the jar packages generated in steps 1 and 2 to the new project's Java build Path to use the classes and functions of the above MAVEN project in the new project.
Also, note that the package type of the Pom.xml file cannot be a war package when you make a jar package, and if you do not make a jar package and use the project's dependencies directly in the Java EE, the package type of the Pom.xml file will be the war package.
Eclipse maven Project exported as Jar package