MAVEN Package jar

Source: Internet
Author: User

Using plug-in Maven-shade-plugin can easily export the way a project has a jar package, and the benefit of the plugin is that it encapsulates the other jar packages that the project relies on, which can be run directly on any JVM. I initially used Eclipse's maven-build to package directly and moved to IntelliJ idea without this button, only to use the command line.

First, add the plug-in to Pom.xml, next use the MVN package, and finally projectname/target/to find the target jar

    <Build>        <Plugins>            <plugin>                <groupId>Org.apache.maven.plugins</groupId>                <Artifactid>Maven-shade-plugin</Artifactid>                <version>2.3</version>                <executions>                    <Execution>                        <Phase>Package</Phase>                        <Goals>                            <goal>Shade</goal>                        </Goals>                        <Configuration>                            <Transformers>                                <TransformerImplementation= "Org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">                                    <MainClass>Core. Test</MainClass>                                </Transformer>                            </Transformers>                        </Configuration>                    </Execution>                </executions>            </plugin>        </Plugins>    </Build>

MAVEN is a great project management tool that I miss when I write C + + code, and I'll use it later, especially if the Maven solution depends on the project, see you soon!

MAVEN Package jar

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: info-contact@alibabacloud.com 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.