How MAVEN can package a local lib file into the war in a Web project

Source: Internet
Author: User
Tags maven central

Scenarios in which a third-party commercialization SDK may be required in some projects may not be included in the MAVEN central repository, so the local Lib package needs to be referenced during the compilation package process.

1. Referencing local jar package compilation

<Dependency>       <groupId>Org. XX (Custom)</groupId>       <Artifactid>XX (Custom)</Artifactid>       <version>1.0</version>       <Scope>System</Scope>       <Systempath>${project.basedir}/libs/xx.jar</systempath</dependency>

2. Package The local jar package into the war

<plugin>    <Artifactid>Maven-war-plugin</Artifactid>    <version>2.6</version>    <Configuration>        <webresources>            <Resource>              <TargetPath>web-inf/lib/</TargetPath>
<Directory>${project.basedir}/libs/</Directory> <includes> <include>*.jar</include> </includes> </Resource> </webresources> </Configuration></plugin>

How MAVEN will package the local LIB file into the war in a Web project

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.