MAVEN Learning Maven package generates an ordinary jar, can run a jar package, contains all dependent jar packages

Source: Internet
Author: User


The Maven build tool can be used to package the project to generate a generic jar package, a runnable jar package, or to package all dependencies together to generate a jar;

One, ordinary jar package

The ordinary jar package contains only the class files compiled by the project source code and the resource files, and does not contain any dependencies, but also includes the Pom file, which indicates the dependency information of the package;
This is written under the project Pom file to generate a generic jar package:


Or, do not write because the packaging default package type is jar

B. Contains all dependent jar packages

The generic jar package, which contains only dependent information in the Pom file and does not contain true dependencies, but also can be packaged to generate a jar file containing all dependencies, refer to this blog post maven package build containing all dependent jar packages

Three, can run jar package

A runnable jar package, which includes all dependencies except the project source compilation results, can be run directly with the Java-jar command. (All dependent jar packages become class directly)
Using MAVEN to build a runnable jar package, you can refer to this blog post maven package to generate an executable jar file.

MAVEN Learning Maven package generates an ordinary jar, can run a jar package, contains all dependent jar packages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.