MAVEN relies on the jar package "go" in the local non-repository

Source: Internet
Author: User

Today, when using a MAVEN compilation to package a Web application, you encounter a problem:

The project was developed with the introduction of a dependency jar package, placed in the Web-inf/lib directory, and the Web Libariary imported through BuildPath.

There is no problem with developing in eclipse, but using MAVEN to compile plug-ins is always a good time to find the classes in the jar package web-inf/lib.

Obviously when compiling the Web-inf/lib is not configured in the Maven-complier-plugin plugin src directory to go,

Then add this directory, or not. Rogue, first install this jar package in the local library and add dependency.

Later, Google found that Maven provided the scope for system dependency, the original document is as follows:

System

This "is" similar to provided except, which has to provide the JAR which contains it explicitly.

The artifact are always available and are not looked up in a repository.

This allows you to add dependency without having to install the jar package in the Web-inf/lib directory into your local library.

The specific configuration recorded:

XML code

<dependency>

<groupId>org.apache</groupId>

<artifactId>test</artifactId>

<version>1.0</version>

<scope>system</scope>

<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/paypal_base.jar</systemPath>

</dependency>

The above GroupID and artifactid these can be filled in just fine.

MAVEN relies on the jar package "go" in the local non-repository

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.